a{
    text-decoration: none;
    color: inherit;
}

.sidebar h1 {
    font-size: 1.6rem;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(140deg, #1994D1 0%, #2F4D9F 100%);
    color: #fff;
    text-align: center;
    line-height: 140px;
    border-radius: 0 1.5rem 0 0;
    height: 140px;
}

.menu-list {
    list-style: none;
}

.menu-item {
    margin-bottom: 4px;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
}
.menu-toggle {
    width: 100%;
    height: 58px;
    text-align: left;
    border-radius: 5px;
    background: transparent;
    color: #1d1d1d;
    padding: 8px 10px;
    font-size: 17px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.menu-toggle.active, .menu-toggle:hover {
    font-weight: 700;
}

.menu-toggle span.icon {
    font-size: 24px;
    font-weight: 200;
    border: 1px solid #ccc;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
}

.menu-item.open .submenu {
    max-height: 500px;
}

/* 메인 영역 */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* 페이지 타이틀 */
.page-title {
    padding: 20px 24px;
    background: #fff;
}

.page-title h2 {
    font-size: 2rem;
    font-weight: 700;
}

.page-title p {
    font-size: 13px;
    color: #6b7280;
}

/* 탑바 */
.topbar {
    height: 56px;
    padding: 0 24px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-left {
    font-size: 16px;
}

.topbar-left a::after {
    content: "\003E";
    margin: 0 5px 0 10px;
    color: #9ca3af;
}
.topbar-left a.current-link::after {
    content: "";
}

.topbar-left img {
    width: 26px;
    height: 26px;
    vertical-align: middle;
}

.topbar-right {
    font-size: 13px;
    color: #6b7280;
}
.topbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #374151;
}

.icon-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}


/* 콘텐츠 그리드 */
.content-wrapper {
    padding: 20px 24px;
    flex: 1;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card {
    background: #ffffff;
    border-radius: 5px;
    border: 1px solid #e5e7eb;
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.card-title{
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  text-align: center;
}

.card-title img{
  display: block;
  max-width: 70%;
  width: auto;
  height: 70px;
  object-fit: contain;
}
.card-title img.size{
  max-width: 60%;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #e5e7eb;
    background: #f8f8fa;
    height: 100%;
    width: 100%;
    border-radius: 5px;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    border-color: #3b82f6;
}

.footer {
    background: #f3f4f6;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
    color: #6b7280;
}


/* ===== 반응형 추가 ===== */

@media (max-width: 1300px) {
  .layout {
    width: 100%;
    max-width: 1200px;
    padding: 0 16px;
  }

  .content-wrapper {
    padding: 20px 16px;
  }
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sidebar {
    width: 220px;
  }

  .topbar {
    padding: 0 16px;
  }
  .card-title img.size {
    max-width: 50%;
  }
}

@media (max-width: 1100px) {
  .layout {
    width: 100%;
    flex-direction: column;
    padding: 0 12px;
  }

  .sidebar {
    width: 100%;
    margin-bottom: 12px;
  }

  .topbar {
    align-items: center;
    height: auto;
    padding: 12px 12px;
    gap: 8px;
  }

  .topbar-left a {
    margin-right: 8px;
  }

  .page-title {
    padding: 24px 0 0;
    margin: 0 auto;
  }

  .content-wrapper {
    padding: 24px 0 24px;
  }

  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card{
    height: 140px;
  }

  .card-title{
    padding: 0.7rem;
  }

  /* ===== 오버레이 메뉴로 쓰일 사이드바 ===== */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #ffffff;
    z-index: 1001;
    box-shadow: 4px 0 16px rgba(0,0,0,0.2);
    padding: 60px 20px 24px;
    margin-bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  /* 메뉴 열린 상태 */
  .sidebar.open {
    transform: translateX(0);
  }

  /* ===== 상단바 ===== */
  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }

  .topbar-left a {
    margin-right: 8px;
  }

  .page-title {
    padding: 16px 0 8px;
    margin: 0 auto;
  }

  .content-wrapper {
    padding: 12px 0 24px;
  }

  /* ===== 햄버거 / 닫기 버튼 영역 ===== */
  .topbar-right {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 1002;
  }

  /* 안에 있던 텍스트 숨김 */
  .topbar-right &gt; * {
    display: none;
  }

  /* 기본 햄버거 라인 2줄 */
  .topbar-right::before,
  .topbar-right::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 2px;
    background: #111;
  }

  .topbar-right::before {
    top: 14px;
  }

  .topbar-right::after {
    top: 24px;
  }

  /* 메뉴 열렸을 때: X 로 */
  body.menu-open .topbar-right::before {
    top: 19px;
    transform: rotate(45deg);
  }

  body.menu-open .topbar-right::after {
    top: 19px;
    transform: rotate(-45deg);
  }

  /* 메뉴 열렸을 때: 어두운 배경 */
  body.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
  }

  body.menu-open {
    overflow: hidden;
  }
}

@media (max-width: 640px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
    .card-footer{
      font-size: 0.85rem;
  }

}
