/* =====================================================================
   MindWiki CSS - Frontend & Admin 분리
   ===================================================================== */

/* === 공통 디자인 토큰 === */
:root {
  --brand:#1bb2d3; /* sky-500 */
  --brand-600:#1bb2d3;
  --brand-700:#1bb2d3;
  --ink:#0f172a; /* slate-900 */
  --muted:#64748b; /* slate-500 */
  --bg:#ffffff;
  --border:#e5e7eb; /* gray-200 */
  --elev:#f8fafc; /* slate-50 */
  --radius-sm:6px;
  --radius-md:8px;
  --radius-lg:12px;
  --radius-xl:16px;
  --shadow-sm:0 1px 2px rgba(0,0,0,.06);
  --shadow-md:0 2px 6px rgba(0,0,0,.08);
  --chart-h-mobile:320px; --chart-h-tablet:360px; --chart-h-desktop:420px; --chart-max-vh:65vh;
}

/* === FRONTEND STYLES === */

/* 기본 스타일 */
*{box-sizing:border-box} 
body{font-family:'Noto Sans KR',system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;margin:0;color:var(--ink);background:#f8fafc;line-height:1.6}
a{color:var(--brand);text-decoration:none}

/* === Frontend Header === */
.site-header {
  background: linear-gradient(135deg, #1bb2d3 0%, #1bb2d3 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* === 헤더 레이아웃 === */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  max-width: 870px;
  margin: 0 auto;
  text-align: center;
}

.header-center-group {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 600px;
  justify-content: center;
}

/* === PC 카테고리 네비게이션 === */
.pc-category-nav {
  display: none;
  background-color: #9fe7f7;
  border-top: 0px;
  border-radius: 10px;
  padding: 6px 0;
  margin: 0 10px;
  position: relative;
  z-index: 101;
}

/* PC 환경에서만 카테고리 네비게이션 표시 */
@media (min-width: 769px) {
  .pc-category-nav {
    display: block !important;
  }
}

/* PC 환경에서 토글 버튼 숨김 */
.menu-toggle {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  left: -9999px !important;
}

.menu-toggle span {
  display: none !important;
  visibility: hidden !important;
}

/* PC 환경에서 검색바 내부 로고 숨김 */
@media (min-width: 769px) {
  .search-logo-link {
    display: none !important;
  }
}

.category-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.category-link {
  color: #374151 !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  display: inline-block;
  background: transparent;
  z-index: 102;
  cursor: pointer;
}

.category-link:not(:last-child)::after {
  content: '';
  color: #9ca3af;
  margin-left: 5px;
}

.category-link:hover {
  color: #1790ac !important;
  background-color: rgba(255, 255, 255, 255);
  border-radius: 30px;
}

.category-link:active {
  color: #0ea5e9 !important;
  background-color: rgba(14, 165, 233, 0.1);
}

/* === 메뉴 스타일 === */
.menu-separator {
  width: 1px;
  height: 20px;
  background: #9ca3af;
  margin: 0 10px;
}

.menu-link {
  color: #374151 !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  display: inline-block;
  background: rgba(27, 178, 211, 0.1);
  border-radius: 20px;
  border: 1px solid rgba(27, 178, 211, 0.2);
  z-index: 102;
  cursor: pointer;
}

.menu-link:hover {
  color: #1790ac !important;
  background-color: rgba(27, 178, 211, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(27, 178, 211, 0.3);
}

.menu-link:active {
  color: #0ea5e9 !important;
  background-color: rgba(14, 165, 233, 0.1);
}

/* === 모바일 메뉴 === */
.menu-toggle {
  display: none;
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: -9999px;
}

.menu-toggle span {
  display: none;
  visibility: hidden;
}

/* === 모바일 메뉴 오버레이 === */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background-color: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu-content {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-menu-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #374151;
}

.menu-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-categories {
  padding: 20px;
}

.mobile-menu-category-link {
  display: block;
  padding: 15px 0;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-menu-category-link:hover {
  color: #1bb2d3;
  background-color: #f8f9fa;
  padding-left: 10px;
}

.mobile-menu-category-link:last-child {
  border-bottom: none;
}

.mobile-menu-category-link:active {
  background-color: #e9ecef;
}

/* === 모바일 메뉴 링크 스타일 === */
.mobile-menu-separator {
  height: 1px;
  background: #e5e7eb;
  margin: 15px 0;
}

.mobile-menu-link {
  display: block;
  padding: 15px 0;
  color: #1bb2d3;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
  position: relative;
  background: rgba(27, 178, 211, 0.05);
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.mobile-menu-link:hover {
  color: #1790ac;
  background-color: rgba(27, 178, 211, 0.1);
  padding-left: 30px;
}

.mobile-menu-link:active {
  background-color: rgba(27, 178, 211, 0.15);
}

/* === 반응형 스타일 === */

/* PC 환경 (769px 이상) */
@media (min-width: 769px) {
  .header-center-group {
    justify-content: center;
    gap: 0px;
  }
  
  .search {
    max-width: 800px;
    flex: 1;
    justify-content: center;
  }
  
  .mw-search-form {
    max-width: 800px;
    width: 100%;
  }
  
  .search input[type="search"] {
    width: 100%;
    padding-left: 20px;
  }
}

/* 모바일/태블릿 환경 (768px 이하) */
@media (max-width: 768px) {
  .topbar {
    position: relative;
    padding: 0;
  }
  
  .header-center-group {
    gap: 0;
    justify-content: center;
    width: 100%;
    flex-direction: column;
    align-items: center;
  }
  
  .logo {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    left: auto !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 0px;
  }
  
  .logo img {
    min-width: 240px;
    max-width: 260px;
    height: auto;
  }
  
  .search {
    flex: 1;
    max-width: calc(100% - 60px);
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .search input[type="search"] {
    padding: 10px 16px;
    font-size: 16px;
    height: auto;
    margin-bottom: 0px;
  }
  
  /* 모바일 스크롤 전 상태에서 로고 아이콘 숨김 */
  .search-logo-link {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
  
  .menu-toggle {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    left: auto !important;
    right: 10px;
    top: 37px;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    width: 45px;
    height: 45px;
    border: 1px solid rgb(68, 184, 230);
    transition: all 0.3s ease;
    cursor: pointer;
  }
  
  .menu-toggle span {
    display: block !important;
    visibility: visible !important;
    width: 20px;
    height: 2px;
    background-color: #2a9de0;
    margin: 4px auto;
    transition: all 0.3s ease;
  }
  
  .menu-toggle:hover {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
  }
  
  .mobile-menu-overlay {
    display: none;
  }
  
  /* 스크롤 시 헤더 최소화 */
  .site-header.scrolled {
    padding: 0;
    transition: all 0.3s ease;
  }
  
  .site-header.scrolled .topbar {
    display: flex !important;
    flex-direction: row !important;
    gap: 0px;
    min-height: 32px;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 1px 4px;
  }
  
  .site-header.scrolled .logo {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    margin-bottom: 0 !important;
  }
  
  .site-header.scrolled .logo img {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
  
  .site-header.scrolled .header-center-group {
    flex-direction: row !important;
    gap: 20px !important;
  }
  
  .site-header.scrolled .search {
    flex: 1 1 auto;
    min-width: 100px;
    max-width: calc(100% - 80px) !important;
    display: flex;
    align-items: left;
    justify-content: left;
  }
  
  .site-header.scrolled .search input {
    padding: 12px 20px;
    font-size: 16px;
    height: auto;
    width: 100%;
    flex: 1 1 auto;
  }
  
  /* 스크롤 시 검색바 내부 로고 표시 - 텍스트처럼 정렬 */
  .site-header.scrolled .search-logo-link {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    left: 12px !important;
    top: 7px !important;
    bottom: 0 !important;
    margin: auto 0 !important;
    z-index: 10 !important;
    width: 24px !important;
    height: 24px !important;
    line-height: 2 !important;
    vertical-align: middle !important;
  }
  
  .site-header.scrolled .search-logo {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 24px !important;
    height: 24px !important;
    object-fit: contain !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    line-height: 1 !important;
  }
  
  /* 로고가 있을 때 검색 입력 필드 패딩 조정 */
  .site-header.scrolled .search input[type="search"] {
    padding-left: 45px;
  }
}

/* === 검색 폼 스타일 === */
.mw-search-form {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 600px;
  position: relative;
  align-items: center;
}

/* 검색바 내부 로고 링크 */
.search-logo-link {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  margin: auto 0;
  z-index: 10;
  text-decoration: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  line-height: 1;
  vertical-align: middle;
}

.search-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: inline-block;
  border: none;
  outline: none;
  vertical-align: middle;
  line-height: 1;
}

.mw-search-form input[type="search"] {
  width: 100%;
  padding: 12px 20px;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  font-size: 16px;
  outline: none;
  box-shadow: 0 2px 5px 1px rgba(64,60,67,.16);
  transition: box-shadow 0.2s;
  background-color: #ffffff;
  color: #333333;
}

.mw-search-form input::placeholder {
  color: #666666 !important;
  opacity: 1 !important;
}

.mw-search-form input::-webkit-input-placeholder {
  color: #666666 !important;
  opacity: 1 !important;
}

.mw-search-form input::-moz-placeholder {
  color: #666666 !important;
  opacity: 1 !important;
}

.mw-search-form input:-ms-input-placeholder {
  color: #666666 !important;
  opacity: 1 !important;
}

.mw-search-form input::-ms-input-placeholder {
  color: #666666 !important;
  opacity: 1 !important;
}

/* === 탭 스타일 === */
.category-tabs-section {
  margin: 20px 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.category-tabs {
  display: flex;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px 8px 0 0;
  margin: 0;
  gap: 0;
  padding: 0 20px;
}

.tab-button {
  background: transparent;
  border: none;
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border-bottom: 3px solid transparent;
}

.tab-button:hover {
  color: #1bb2d3;
  background-color: rgba(27, 178, 211, 0.05);
}

.tab-button.active {
  color: #1bb2d3;
  background-color: #fff;
  border-bottom-color: #1bb2d3;
  font-weight: 600;
}

.tab-content {
  display: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 24px;
  margin: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tab-content.active {
  display: block;
}

.tab-posts {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.tab-posts .category-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.2s ease;
  position: relative;
}

.tab-posts .category-card:hover {
  border-color: #1bb2d3;
  box-shadow: 0 2px 8px rgba(27, 178, 211, 0.1);
}

.tab-posts .category-card h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}

.tab-posts .category-card h3 a {
  color: #1e293b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tab-posts .category-card h3 a:hover {
  color: #1bb2d3;
}

.tab-posts .category-card p {
  margin: 0 0 12px 0;
  color: #64748b;
  line-height: 1.6;
  font-size: 14px;
}

.tab-posts .category-card .post-meta {
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.tab-more {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

.more-button {
  display: inline-block;
  padding: 12px 24px;
  background: #1bb2d3;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  border: 1px solid #1bb2d3;
}

.more-button:hover {
  background: #1bb2d3;
  border-color: #1bb2d3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 178, 211, 0.2);
  color: white;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .category-tabs-section {
    margin: 20px 0;
  }
  
  .category-tabs {
    flex-wrap: wrap;
    padding: 0 16px;
  }
  
  .tab-button {
    flex: 1;
    min-width: 80px;
    padding: 12px 8px;
    font-size: 13px;
    text-align: center;
  }
  
  .tab-content {
    padding: 20px 16px;
  }
  
  .tab-posts {
    gap: 12px;
  }
  
  .tab-posts .category-card {
    padding: 16px;
  }
  
  .tab-posts .category-card h3 {
    font-size: 16px;
  }
  
  .tab-more {
    margin-top: 20px;
    padding-top: 16px;
  }
  
  .more-button {
    padding: 10px 20px;
    font-size: 13px;
  }
  
  .tab-posts .category-card h3 {
    font-size: 15px;
  }
  
  .tab-posts .category-card p {
    font-size: 13px;
  }
}

.site-header .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 20px;
}

.logo a {
  display: inline-block;
  transition: transform 0.2s ease;
}

.logo a:hover {
  transform: scale(1.02);
}

.logo img {
  width: 230px;
  height: auto;
  display: block;
}


.search form {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* 이 스타일은 제거됨 - 모바일 스크롤 상태와 충돌 */

.search input[type="search"]:focus {
  outline: none;
  border-color: #1bb2d3;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(27, 178, 211, 0.1);
}

.search input[type="search"]::placeholder {
  color: #666666;
}

.search select {
  padding: 14px 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 25px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 14px;
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.search select option {
  background: #1bb2d3;
  color: #fff;
}

.search button {
  padding: 14px 24px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 25px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.search button:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-1px);
}

.nav {
  margin-top: 0;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
  justify-content: center;
}

.nav a {
  color: #fff;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 20px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: block;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
}

.nav a:hover,
.nav a.active {
  background: rgba(255,255,255,0.25);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* === Frontend Layout === */
.container {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 20px;
}

.layout {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 40px;
  align-items: start;
}

/* 위젯 영역 강제 표시 */
.widgets.mw-sidebar {
  display: block !important;
  visibility: visible !important;
  min-height: 200px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
}

/* === Frontend Article Cards === */
.article {
  min-height: 400px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: visible; /* head-box 호버 시 상단 테두리가 잘리지 않도록 */
}

/* === 목차 스타일 === */
.toc-box {
  margin: 20px 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f1f5f9;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.toc-header:hover {
  background: #e2e8f0;
}

.toc-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.toc-toggle {
  font-size: 12px;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.toc-toggle.open {
  transform: rotate(180deg);
}

.toc-content {
  padding: 0 16px 12px 16px;
  background: #fff;
}

.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-list li {
  margin: 4px 0;
  padding: 0;
}

.toc-list a {
  display: block;
  padding: 6px 8px;
  color: #4b5563;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.toc-list a:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.toc-list a.h1 {
  font-weight: 600;
  color: #1f2937;
  border-left: 3px solid #3b82f6;
  padding-left: 12px;
}

.toc-list a.h2 {
  padding-left: 20px;
  color: #374151;
}

.toc-list a.h3 {
  padding-left: 32px;
  color: #6b7280;
  font-size: 12px;
}

/* 헤더 높이 보정을 위한 스크롤 오프셋 */
html {
  scroll-padding-top: 100px; /* 기본 헤더 높이 + 여백 */
}

/* 모바일 환경에서 헤더 높이 조정 */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 120px; /* 모바일 헤더 높이 + 여백 */
  }
}

/* 동적 헤더 높이 감지를 위한 CSS 변수 */
:root {
  --header-height: 100px;
}

@media (max-width: 768px) {
  :root {
    --header-height: 120px;
  }
}

/* === Box Components === */
.box {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.head-box {
  margin-top: 4px; /* 호버 시 위로 이동할 공간 확보 */
  margin-bottom: 20px;
  padding: 32px;
  background: #ffffff;
  border: 2px solid #1bb2d3;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative; /* z-index를 위한 position 설정 */
  z-index: 1; /* 다른 요소 위에 표시 */
}

.head-box:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  z-index: 2; /* 호버 시 더 위에 표시 */
}

.head-box h1 {
  margin: 0 0 24px 0;
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  position: relative;
  line-height: 1.3;
  padding-bottom: 16px;
}

.head-box h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #1bb2d3, #0ea5e9);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.head-box:hover h1::after {
  width: 80px;
}

.head-box .summary {
  font-size: 18px;
  line-height: 1.6;
  color: #4a5568;
  margin: 20px 0;
  font-weight: 400;
  background: #f8fafc;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #1bb2d3;
}

.head-box .post-meta {
  font-size: 14px;
  color: #6b7280;
  margin: 20px 0 0 0;
  font-weight: 500;
  background: #f1f5f9;
  padding: 12px 16px;
  border-radius: 8px;
  display: inline-block;
}

/* Search page specific header box styles */
.search-page .box.head-box {
  padding: 16px 20px !important;
  margin-bottom: 16px !important;
}

.search-page .box.head-box h1 {
  font-size: 20px !important;
  margin: 0 0 12px 0 !important;
  padding-bottom: 8px !important;
}

.search-page .box.head-box .mw-meta {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.search-page .box.head-box .mw-meta span {
  margin-right: 16px;
  display: inline-block;
}

.search-page .box.head-box .mw-meta strong {
  color: #1bb2d3;
  font-weight: 600;
}

.article-box {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* === Video Embed Box === */
.video-box {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 0;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.video-embed-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-embed-wrapper iframe,
.video-embed-wrapper video,
.video-embed-wrapper embed,
.video-embed-wrapper object {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Video embed 반응형 스타일 */
@media (max-width: 768px) {
  .video-box {
    margin-bottom: 20px;
    border-radius: 8px;
  }
  
  .video-embed-wrapper {
    padding-bottom: 56.25%; /* 모바일에서도 16:9 비율 유지 */
  }
}

@media (max-width: 480px) {
  .video-box {
    margin-bottom: 16px;
    border-radius: 6px;
  }
  
  .video-embed-wrapper {
    padding-bottom: 56.25%; /* 작은 모바일에서도 16:9 비율 유지 */
  }
}

/* 태블릿 환경 (768px ~ 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .video-box {
    margin-bottom: 24px;
  }
  
  .video-embed-wrapper {
    padding-bottom: 56.25%; /* 태블릿에서도 16:9 비율 유지 */
  }
}

.faq-box {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


/* 중복 제거됨 */

/* === 통합된 .mw-card 스타일 === */
.mw-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 0 0 24px 0;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.mw-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #1bb2d3, #1bb2d3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mw-card:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  transform: translateY(-4px);
  border-color: #1bb2d3;
}

.mw-card:hover::before {
  opacity: 1;
}

.mw-card h2 {
  margin: 0 0 16px 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
}

.mw-card h2 a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.3s ease;
}

.mw-card h2 a:hover {
  color: var(--brand);
}

.mw-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: #64748b;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

/* 태그/배지 스타일 */
.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.badge.primary {
  background: linear-gradient(135deg, #1bb2d3, #1bb2d3);
  color: #fff;
  box-shadow: 0 2px 8px rgba(27, 178, 211, 0.3);
}

.badge.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 178, 211, 0.4);
}

.badge.secondary {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.badge.secondary:hover {
  background: #e2e8f0;
  color: #475569;
}

/* === Frontend Sidebar === */
.mw-sidebar {
  position: sticky;
  top: 100px;
}

.widget {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: all 0.3s ease;
}

.widget:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.widget .widget-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--ink);
  position: relative;
}

.widget .widget-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  background: linear-gradient(135deg, #1bb2d3, #1bb2d3);
  border-radius: 2px;
}

.widget .widget-empty {
  color: #64748b;
  font-size: 14px;
  padding: 24px;
  text-align: center;
  background: #f8fafc;
}



/* 위젯3: 광고 배너 */
.ad-banner-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ad-banner-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.ad-banner-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.ad-banner-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.ad-banner-item:hover img {
  transform: scale(1.02);
}

.ad-link {
  display: block;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.ad-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(27, 178, 211, 0.1), rgba(14, 165, 233, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ad-link:hover::after {
  opacity: 1;
}

/* 광고 슬라이더 */
.ad-slider-viewport {
  overflow: hidden;
  width: 100%;
}

.ad-slider-track {
  display: flex;
  width: 100%;
  transition: transform 0.6s ease;
  will-change: transform;
}

.ad-slide {
  flex: 0 0 100%;
  box-sizing: border-box;
  padding: 0;
}

/* === 슬라이더 스타일 === */
.slider-section {
  margin: 0 0 20px 0;
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.slider-container {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  background: transparent;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 모바일에서 슬라이더 컨테이너 크기 조정 */
@media (max-width: 768px) {
  .slider-container {
    min-height: 300px;
    height: auto;
  }
}

@media (max-width: 480px) {
  .slider-container {
    min-height: 200px;
    height: auto;
  }
}

.slider-wrapper {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 200px;
}

.slider-track {
  display: flex;
  width: 100%;
  transition: transform 0.6s ease;
  height: auto;
}

.slider-slide {
  flex: 0 0 100%;
  position: relative;
  width: 100%;
  height: auto;
}

.slide-content {
  position: relative;
  width: 100%;
  height: auto;
  overflow: hidden;
}

.slide-media {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 16px;
}

/* PC용 슬라이더 이미지 크기 설정 */
@media (min-width: 769px) {
  .slide-media {
    max-height: 400px; /* PC용 권장 높이 */
    min-height: 200px; /* 최소 높이 보장 */
  }
  
  .slider-wrapper {
    min-height: 200px; /* PC용 슬라이더 최소 높이 */
  }
}

.slide-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  padding: 40px 30px 30px;
  color: white;
}

.slide-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;  
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.slide-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.slide-link:hover {
  transform: scale(1.02);
}

/* 슬라이더 반응형 스타일 */
@media (max-width: 768px) {
  .slider-wrapper {
    min-height: auto;
    height: auto;
  }
  
  .slide-media {
    max-height: 400px;
    min-height: 300px;
    height: 300px;
    object-fit: cover;
    object-position: center;
    width: 100%;
  }
  
  .slide-title {
    font-size: 18px;
    padding: 20px;
  }
  
  .slider-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .slider-dots {
    bottom: 15px;
  }
  
  .dot {
    width: 8px;
    height: 8px;
    margin: 0 4px;
  }
}

@media (max-width: 480px) {
  .slider-wrapper {
    min-height: auto;
    height: auto;
  }
  
  .slide-media {
    max-height: 300px;
    min-height: 200px;
    height: 200px;
    object-fit: cover;
    object-position: center;
  }
  
  .slide-title {
    font-size: 16px;
    padding: 15px;
  }
  
  .slider-btn {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}

.slider-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
}

.slider-btn {
  background: rgba(255,255,255,0.9);
  opacity: 0.5;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.slider-btn:hover {
  background: white;
  transform: scale(1.1);
}

.slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: white;
  transform: scale(1.2);
}

/* === 주제별 콘텐츠 스타일 === */
.category-content-section {
  margin: 40px 0;
}

.category-group {
  margin-bottom: 40px;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.category-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.category-title a {
  color: #1e293b;
  text-decoration: none;
  transition: color 0.3s ease;
}

.category-title a:hover {
  color: var(--brand);
}

.category-more {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
}

.category-more:hover {
  color: var(--brand-600);
  transform: translateX(4px);
}

.category-posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.category-card {
  padding: 16px;
  transition: all 0.3s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* === Frontend Footer === */
.site-footer {
  margin-top: 64px;
  border-top: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #1bb2d3, #1bb2d3);
}

/* Footer Container */
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.footer-section {
  margin-bottom: 16px;
}

/* 관련사이트 섹션 */
.related-sites-section {
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}

.related-sites-select {
  display: block;
  max-width: 300px;
  width: 100%;
}

.related-sites-dropdown {
  width: 100%;
  padding: 12px 20px;
  border: 2px solid #1bb2d3;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"%3E%3Cpath fill="%231bb2d3" d="M6 9L1 4h10z"/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 40px;
}

.related-sites-dropdown:hover {
  border-color: #1790ac;
  box-shadow: 0 2px 8px rgba(27, 178, 211, 0.15);
}

.related-sites-dropdown:focus {
  outline: none;
  border-color: #1790ac;
  box-shadow: 0 0 0 3px rgba(27, 178, 211, 0.15);
}

/* 사이트 정보 섹션 */
.site-info-section {
  text-align: left;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.footer-brand {
  margin-bottom: 4px;
}

.footer-brand .copyright {
  margin: 0;
  font-size: 15px;
  color: #1e293b;
  line-height: 1.6;
}

.footer-brand .copyright strong {
  color: #1bb2d3;
  font-weight: 700;
}

.footer-brand .copyright .operator {
  color: #94a3b8;
  margin: 0 6px;
}

.footer-brand .copyright a {
  color: #1bb2d3;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-brand .copyright a:hover {
  color: #1790ac;
  text-decoration: underline;
}

/* 공지사항 */
.footer-notice {
  margin: 6px 0;
}

.footer-notice p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

/* 연락처 정보 */
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
}

.contact-item {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.contact-label {
  color: #94a3b8;
  font-weight: 500;
}

.contact-value {
  color: #475569;
  font-weight: 600;
}

/* 푸터 링크 */
.footer-links {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #1bb2d3;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  padding: 4px 8px;
  border-radius: 4px;
}

.footer-links a:hover {
  color: #1790ac;
  background: rgba(27, 178, 211, 0.1);
  text-decoration: none;
}

.footer-links .separator {
  color: #cbd5e1;
  margin: 0 4px;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .footer-container {
    padding: 16px;
  }
  
  .related-sites-select {
    max-width: 100%;
  }
  
  .footer-contact {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .contact-item {
    justify-content: flex-start;
    font-size: 12px;
  }
  
  .footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .footer-links .separator {
    display: none;
  }
  
  .footer-info {
    align-items: flex-start;
  }
  
  .footer-brand .copyright {
    font-size: 14px;
  }
  
  .footer-notice p {
    font-size: 12px;
  }
}

/* === 반응형 디자인 === */
@media (max-width: 1024px) {
  .topbar {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }
  
  .search {
    max-width: 100%;
    margin: 0;
  }
  
  .layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .mw-sidebar {
    position: static;
    order: 2; /* 위젯을 아래로 이동 */
  }
  
  .article {
    order: 1; /* 본문을 위로 이동 */
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  .layout {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  .article {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  .site-header .wrap {
    padding: 16px;
  }
  
  .topbar {
    gap: 16px;
  }
  
  .logo img {
    width: 160px;
  }
  
  .search form {
    flex-direction: column;
    gap: 12px;
  }
  
  .search input[type="search"] {
    font-size: 16px;
    padding: 12px 16px;
  }
  
  .nav ul {
    flex-direction: column;
    gap: 8px;
  }
  
  .nav a {
    padding: 12px 16px;
    text-align: center;
  }
  
  /* 모바일에서 패딩 조정 */
  .mw-card {
    padding: 20px;
  }
  
  .widget .widget-title {
    padding: 16px 20px;
    font-size: 16px;
  }
  
  .useful-links-list a,
  .popular-list a {
    padding: 12px 20px;
  }
  
  .popular-list a {
    padding-left: 50px;
  }
  
  .head-box {
    margin-bottom: 24px;
    padding: 24px;
  }
  
  .head-box h1 {
    font-size: 28px;
    margin-bottom: 20px;
    padding-bottom: 12px;
  }
  
  .head-box .summary {
    font-size: 16px;
    padding: 16px;
    margin: 16px 0;
  }
  
  .head-box .post-meta {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  /* Search page mobile styles */
  .search-page .box.head-box {
    padding: 12px 16px !important;
    margin-bottom: 16px !important;
  }
  
  .search-page .box.head-box h1 {
    font-size: 18px !important;
    margin: 0 0 8px 0 !important;
    padding-bottom: 6px !important;
  }
  
  .search-page .box.head-box .mw-meta {
    font-size: 13px;
    line-height: 1.3;
  }
  
  .search-page .box.head-box .mw-meta span {
    margin-right: 12px;
    display: block;
    margin-bottom: 2px;
  }
  
  .mw-body {
    font-size: 15px;
  }
  
  .mw-body h1 { font-size: 24px; }
  .mw-body h2 { font-size: 20px; }
  .mw-body h3 { font-size: 18px; }
  
  .faq-item summary {
    padding: 12px 16px;
    font-size: 15px;
  }
  
  .faq-item .answer {
    padding: 16px;
  }
  
  /* 모바일에서 카드 레이아웃 조정 */
  .mw-card > div[style*="display:flex"] {
    flex-direction: column !important;
    gap: 16px !important;
  }
  
  .mw-card > div[style*="display:flex"] > div[style*="flex-shrink:0"] {
    width: 100% !important;
  }
  
  .mw-card > div[style*="display:flex"] > div[style*="flex-shrink:0"] img {
    height: 200px !important;
  }
}

/* === Button style === */
  .mw-wrap{max-width:1000px;margin:84px auto 24px;padding:0 16px}
  /* dedupe: keep single .mw-card definition above; this inner variant only tweaks section header */
  /* 위젯용 .mw-card 스타일 */
  .mw-card h3{margin:0;padding:10px 14px;border-bottom:1px solid var(--border);background:#fafafa;border-radius:12px 12px 0 0}
  .mw-card .inner{padding:14px}
  .row{display:grid;grid-template-columns:160px 1fr;gap:12px;align-items:center}
  .row + .row{margin-top:8px}
  .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius-md);background:#fff;cursor:pointer;color:var(--ink);transition:background .2s,border-color .2s,box-shadow .2s}
  .btn:hover{background:#f8fafc;border-color:#cbd5e1}
  .btn:focus{outline:2px solid var(--brand-600);outline-offset:1px}
  .btn:disabled{opacity:.6;cursor:not-allowed}
  .btn.primary{background:var(--brand);color:#fff;padding:10px 12px;margin:8px 0;border-color:var(--brand-600)}
  .btn.primary:hover{background:var(--brand-600);border-color:var(--brand-700)}
  .btn.ghost{background:transparent;color:var(--ink)}
  .btn.ghost:hover{background:#f1f5f9}
  .out{white-space:pre-wrap;border:1px dashed #ddd;border-radius:12px;background:#fafafa;padding:10px;margin-top:10px;min-height:120px}
  .hint{color:#666;font-size:12px;margin-top:4px}

/* === Admin fixed header === */
body.admin{padding-top:64px;}
.mw-admin-header{display:flex;align-items:center;justify-content:center;border-bottom:1px solid var(--border);background:#fff}
.mw-admin-header--fixed{position:fixed;top:0;left:0;right:0;z-index:1000}
.mw-admin-header__inner{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:1200px;width:100%;padding:10px 16px}
.mw-admin-logo{font-weight:800;font-size:18px}
.mw-admin-nav a{margin:0 8px;display:inline-block;padding:6px 10px;border-radius:10px}
.mw-admin-nav a:hover{background:#f0f9ff}
.mw-admin-main{max-width:1200px;margin:16px auto;padding:0 16px}

/* === Charts: responsive fixed-height wrapper === */
.mw-chart{position:relative;width:100%;height:var(--chart-h-desktop);max-height:var(--chart-max-vh);margin:16px 0;overflow:hidden}
.mw-chart canvas{display:block;width:100% !important;height:100% !important}
@media (max-width:767.98px){ .mw-chart{height:var(--chart-h-mobile)} }
@media (min-width:768px) and (max-width:1199.98px){ .mw-chart{height:var(--chart-h-tablet)} }
@media (min-width:1200px){ .mw-chart{height:var(--chart-h-desktop)} }
@media (max-width:767.98px) and (orientation:landscape){ .mw-chart{height:calc(var(--chart-h-mobile) + 40px)} }

/* OG 미리보기 */
.mw-og-preview .hint{font-size:12px;color:#777;margin:8px 0 6px}

/* === Readable font sizes for all form controls ============================= */
input[type="text"],
input[type="url"],
input[type="email"],
input[type="search"],
input[type="password"],
input[type="datetime-local"],
input[type="number"],
input[type="file"],
input[type="date"],

textarea,
select {
  font-size: 16px;
  line-height: 1.5;
  padding: 10px 12px;
  margin: 8px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;  
}
input:focus, textarea:focus, select:focus{border-color:var(--brand-600);box-shadow:0 0 0 3px rgba(2,132,199,.15);outline:none}

/* === button form controls ============================= */
button[type="submit"],
button[type="button"]{
  font-size:16px; line-height:1.5; padding:10px 12px; margin:8px 0;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background-color:#f8fafc; color:var(--ink);
  transition:border-color .2s, box-shadow .2s, background .2s;
}
button[type="submit"]{ background:var(--brand); color:#fff; border-color:var(--brand-600); }
button[type="submit"]:hover{ background:var(--brand-600); border-color:var(--brand-700); }
button[type="button"]:hover{ background:#eef2f7; }

button[type="submit"]:focus{ outline:2px solid var(--brand-600); outline-offset:1px; }

/* HR style */
hr { border:none; height:1px; background-color:var(--border); margin:20px 0; }

hr.hr-brand { border:none; height:1px; background-color:#d1d1d1; margin:20px 0; }

hr.hr-dotted { border:0; border-top:1px dotted #d1d1d1; background:none; }

/* Ensure article body font matches editor textarea */
.mw-body { 
  font-size: 16px; 
  line-height: 1.8; 
  color: #232428;
}

.mw-body h1, .mw-body h2, .mw-body h3, .mw-body h4, .mw-body h5, .mw-body h6 {
  color: #1e293b;
  font-weight: 600;
  margin: 32px 0 16px 0;
  line-height: 1.4;
}

.mw-body h1 { font-size: 28px; }
.mw-body h2 { font-size: 24px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid #000000; }
.mw-body h3 { font-size: 20px; }
.mw-body h4 { font-size: 18px; }

.mw-body p {
  margin: 16px 0;
  color: #30343b;
}

.mw-body ul, .mw-body ol {
  margin: 16px 0;
  padding-left: 24px;
}

.mw-body li {
  margin: 8px 0;
  color: #4a5568;
}

.mw-body blockquote {
  border-left: 4px solid #1bb2d3;
  background: #f8fafc;
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #4a5568;
}

.mw-body code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  color: #e11d48;
}

.mw-body pre {
  background: #1e293b;
  color: #f1f5f9;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
}

.mw-body pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.mw-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mw-body a {
  color: #1bb2d3;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.mw-body a:hover {
  color: #0ea5e9;
  border-bottom-color: #0ea5e9;
}


/* Basic resets */
body{margin:0}

/* 중복된 스타일 제거됨 - 위에서 이미 정의됨 */

/* index search contents box style */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-weight: 300;
  color: #fff;
  background-color: var(--brand);
  font-size: 0.9em;
}

/* FAQ */
.post-faq { 
  margin-top: 32px; 
}

.post-faq h2 { 
  font-size: 24px; 
  margin: 0 0 20px 0; 
  color: #1e293b;
  font-weight: 600;
}

.faq-item { 
  margin: 12px 0; 
  border: 1px solid #e2e8f0; 
  border-radius: 12px; 
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.faq-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.faq-item summary { 
  cursor: pointer; 
  font-weight: 600; 
  padding: 16px 20px; 
  outline: none; 
  list-style: none;
  color: #1e293b;
  font-size: 16px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.faq-item summary:hover {
  background: #f8fafc;
}

.faq-item[open] summary { 
  border-bottom: 1px solid #e2e8f0; 
  background: #f8fafc;
  border-radius: 12px 12px 0 0;
}

.faq-item .answer { 
  padding: 20px; 
  line-height: 1.7; 
  white-space: pre-wrap;
  color: #4a5568;
  background: #fff;
  border-radius: 0 0 12px 12px;
}

/* === 키워드 해시태그 스타일 === */
.post-keywords {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.post-keywords h2 {
  margin: 0 0 1rem 0;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 600;
  border-bottom: 2px solid var(--brand);
  padding-bottom: 0.5rem;
}

.keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.keyword-tag {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: linear-gradient(135deg, var(--brand) 0%, #0ea5e9 100%);
  color: white;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(27, 178, 211, 0.2);
  border: none;
  cursor: pointer;
}

.keyword-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(27, 178, 211, 0.3);
  background: linear-gradient(135deg, #0ea5e9 0%, var(--brand) 100%);
  color: white;
  text-decoration: none;
}

.keyword-tag:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(27, 178, 211, 0.2);
}

.keyword-tag::before {
  content: '#';
  margin-right: 0.2rem;
  font-weight: 600;
}

/* === 연관 콘텐츠 스타일 === */
.post-related {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.post-related h2 {
  margin: 0 0 1rem 0;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 600;
  border-bottom: 2px solid var(--brand);
  padding-bottom: 0.5rem;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.related-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.related-item:hover {
  background: #f8fafc;
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.related-item-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--brand) 0%, #0ea5e9 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.related-item-content {
  flex: 1;
  min-width: 0;
}

.related-item-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.25rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-item-meta {
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.related-item-date {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.related-item-date::before {
  content: '📅';
  font-size: 0.75rem;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .related-item {
    padding: 0.75rem;
  }
  
  .related-item-icon {
    width: 32px;
    height: 32px;
    margin-right: 0.75rem;
    font-size: 0.75rem;
  }
  
  .related-item-title {
    font-size: 0.875rem;
  }
  
  .related-item-meta {
    font-size: 0.75rem;
  }
}

/* Footer - 중복 제거됨 (위의 더 상세한 스타일 사용) */

/* Blocked notice */
.blocked{ max-width:900px; margin:24px auto; }

/* Summary styles */
.summary {
  font-size: 16px;
  line-height: 1.6;
  color: #4a5568;
  margin: 16px 0;
}

/* FAQ styles */
.faq-list {
  margin: 0;
  padding: 0;
}

/* 중복 제거됨 */

/* Admin notice styles */
.admin-notice {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  padding: 15px;
  margin: 20px 0;
  border-radius: 5px;
}

.admin-notice h3 {
  margin: 0 0 10px 0;
  color: #856404;
}

.admin-notice p {
  margin: 8px 0;
  color: #856404;
}

.btn-publish {
  background: #28a745;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.btn-publish:hover {
  background: #218838;
}
.blocked h1{ margin-top:0; font-size:20px; }
.blocked p{ margin:8px 0; }

/* Head box spacing - removed duplicate style */

/* === Admin ai_autowrite layout (moved from inline) ======================== */
.mw-form--wide{ width:100%; max-width:100%; display:block; }
.mw-form--wide.mw-card{ max-width:100%; }
.mw-form--autowrite .settings-grid{
  display:grid; grid-template-columns:180px 1fr; gap:12px 16px; align-items:center;
}
.mw-form--autowrite input[type="text"],
.mw-form--autowrite select,
.mw-form--autowrite textarea{ width:100%; box-sizing:border-box; }
.mw-form--autowrite .divider{ height:1px; background:var(--border); margin:16px 0 12px; }
.mw-form--autowrite .table-wrap{ width:100%; overflow:auto; }
.mw-form--autowrite .table-wrap .mw-table{ width:100%; table-layout:auto; }
.mw-form--autowrite .actions{ margin-top:15px; display:flex; gap:8px; }
.mw-radios, .mw-checks{ display:flex; flex-wrap:wrap; gap:10px 16px; }
.mw-radios label, .mw-checks label{ display:flex; gap:6px; align-items:center; }
.mw-admin-main .mw-form {max-width: 100%; margin: 20px auto;}
.mw-admin-main .mw-form form {width: 100%;}

/* === content box (with maum-sopoong) ======================== */
.content-source-box {
  background-color: #f8f8f8;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-top: 40px;
  font-family: 'Noto Sans KR', sans-serif;
  color: #333;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  max-width: 100%;
}

.content-source-box h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #000;
}

.content-source-box p {
  font-size: 1rem;
  margin-bottom: 12px;
}

.content-source-box strong {
  font-weight: 700;
}

.content-source-box a {
  color: #0066cc;
  text-decoration: underline;
}

.content-summary {
  background-color: #ffffff;
  border: 2px solid #2b2b2b;
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-top: 0px;
  font-family: 'Noto Sans KR', sans-serif;
  color: #1b1b1b;
  line-height: 1.6;
  max-width: 100%;
}

.content-summary h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #505050;
}

.content-summary p {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.content-summary strong {
  font-weight: 700;
}

.content-summary a {
  color: #0066cc;
  text-decoration: underline;
}

/* assets/css/scrolltop.css */
.mw-scrolltop {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1bb2d3;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: none;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  font-size: 14px;
  font-weight: bold;
}

.mw-scrolltop:hover { 
  background: #0ea5e9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

.mw-scrolltop:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.mw-scrolltop--show {
  opacity: 0.7;
  transform: translateY(0);
  pointer-events: auto;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .mw-scrolltop {
    right: 20px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .mw-scrolltop {
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
    font-size: 12px;
  }
}

/* search highlight */
.highlight,
mark.highlight {
  background-color: #e9a920; /* 브랜드 컬러 */
  color: white;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: bold;
}

/* widget css */
.widgets .widget{ border:1px solid var(--border); border-radius:12px; background:#fff; margin-bottom:16px; }
.widgets .widget h3{ margin:0; padding:10px 12px; border-bottom:1px solid var(--border); font-size:16px; background:#fafafa; border-top-left-radius:12px; border-top-right-radius:12px; }
.widgets .empty{ color:#888; font-size:14px; padding:10px 12px; }

/* 사이드바 범위 스코프(전역 CSS와 충돌 방지) */
.mw-sidebar .widget{padding:12px; border:1px solid var(--border); border-radius:12px; background:#fff; margin-bottom:16px;}
.mw-sidebar .widget .widget-title{font-size:18px; font-weight:700; margin:0 0 10px;}
.mw-sidebar .widget-empty{color:#888; font-size:14px;}

/* 위젯1: 유용한 정보 */
.mw-sidebar .useful-links-list{
  list-style: none;
  margin: 0;
  padding: 0;
}

.mw-sidebar .useful-links-list li{
  margin: 0;
  border-bottom: 1px solid #f1f5f9;
}

.mw-sidebar .useful-links-list li:last-child{
  border-bottom: none;
}

.mw-sidebar .useful-links-list a{
  display: block;
  padding: 12px 16px;
  color: #000 !important;
  text-decoration: none;
  transition: all 0.3s ease;
}

.mw-sidebar .useful-links-list a:hover{
  color: var(--brand) !important;
  background: #f8fafc;
  text-decoration: underline;
}

/* 위젯2: 인기 콘텐츠 */
.mw-sidebar .popular-list{
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: popular-counter;
}

.mw-sidebar .popular-list li{
  margin: 0;
  border-bottom: 1px solid #f1f5f9;
  counter-increment: popular-counter;
  position: relative;
}

.mw-sidebar .popular-list li:last-child{
  border-bottom: none;
}

.mw-sidebar .popular-list li::before{
  content: counter(popular-counter);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: var(--brand);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.mw-sidebar .popular-list a{
  display: block;
  padding: 12px 16px 12px 50px;
  color: #000 !important;
  text-decoration: none;
  transition: all 0.3s ease;
}

.mw-sidebar .popular-list a:hover{
  color: var(--brand) !important;
  background: #f8fafc;
  text-decoration: underline;
}

/* 위젯3: 광고 배너 (세로 스택) */
.mw-sidebar .ad-banner-list{
  list-style:none; margin:0; padding:0;
  display:flex; flex-direction:column; gap:10px;   /* 항상 세로 정렬 */
}
.mw-sidebar .ad-banner-item img{
  width:100%; height:auto; display:block;
  border-radius:10px; border:1px solid #eee;       /* 이미지 가로 100% 고정 */
}
/* 슬라이더 */
.mw-sidebar .ad-slider-viewport{overflow:hidden; width:100%;}
.mw-sidebar .ad-slider-track{
  display:flex; width:100%;
  transition: transform .6s ease; will-change: transform;
}
.mw-sidebar .ad-slide{flex:0 0 100%; box-sizing:border-box; padding:0;}
/* 링크 색상 고정 */
.mw-sidebar .widget-ad-banners .ad-link{ color:#000 !important; }
.mw-sidebar .widget-ad-banners .ad-link:visited{ color:#000 !important; }
.mw-sidebar .widget-ad-banners .ad-link:hover{ color:#000 !important; text-decoration:underline; }

/* 카드 하단 메타(게시일/키워드 등) */
.mw-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: #666;
}

/* 페이지네이션 */
.pagination {
  display: flex;
  justify-content: center;      /* ? 가운데 정렬 */
  align-items: center;          /* ? 세로 중앙 정렬 */
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pagination .btnp {
  display: inline-flex;         /* ? flex로 세로 중앙 맞춤 */
  align-items: center;          /* ? 버튼 내부 텍스트 세로 정렬 */
  justify-content: center;
  padding: 6px 14px;
  min-width: 70px;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-decoration: none;
  color: #222;
  background: #fff;
  line-height: 1.4;
  font-size: 14px;
  transition: all 0.2s ease;
  cursor:pointer
}

.pagination .btnp:hover,
.pagination .btnp:focus {
  border-color: var(--brand);
  color: var(--brand);
  outline: none;
}

.pagination .page-info {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
  display: inline-flex;          /* ? 페이지 정보도 flex로 세로 정렬 */
  align-items: center;
  padding: 0 4px;
}

/* (옵션) 디버그 박스: MW_DEBUG=true일 때만 노출 */
.mw-debug {
  background: #222;
  color: #ddd;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  white-space: pre-wrap;
  margin-bottom: 10px;
}

/* 반응형: 좁은 화면에서 썸네일을 위로 올리고 너비 100% */
@media (max-width: 780px) {
  .mw-thumb {
    float: none;
    width: 100%;
    margin: 0 0 10px 0;
    border-radius: 12px;
  }
  .mw-thumb img {
    height: 180px; /* 화면이 좁을수록 세로를 조금 키워 가독성 향상 */
  }
  .mw-card-meta {
    gap: 8px;
    font-size: 12px;
  }
}

/* === AI Autowrite 페이지 전용 스타일 ======================== */
.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  cursor: pointer;
}

.response-box {
  display: none;
  margin-top: 16px;
  padding: 16px;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'Courier New', monospace;
  font-size: 13px;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
}

.inline-form {
  display: inline-block;
  margin: 0;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-select {
  min-width: 120px;
  font-size: 13px;
}

.btn.small {
  padding: 6px 12px;
  font-size: 12px;
}

/* 테이블 컬럼 너비 */
.col-id { width: 70px; }
.col-title { min-width: 200px; }
.col-category { width: 200px; }
.col-status { width: 120px; }
.col-date { width: 160px; }
.col-actions { width: 180px; }


/* 심플한 표 스타일 */
.mwsimple-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
}

.mwsimple-table th,
.mwsimple-table td {
  border: 1px solid #ddd;
  padding: 10px 12px;
  text-align: center;
}

.mwsimple-table th {
  background-color: #bcd0f3;
  color: #222;
  font-weight: 600;
}

.mwsimple-table td:first-child {
  text-align: left;
  font-weight: 500;
  background-color: #fff;
}

.mwsimple-table tr:nth-child(even) td {
  background-color: #fcfcfc;
}

.mwsimple-table tr:hover td {
  background-color: #f0f6ff;
}

/* 배지 스타일 개선 */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.planned {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.badge.drafted {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fbbf24;
}

.badge.approved {
  background: #dbeafe;
  color: #2563eb;
  border: 1px solid #60a5fa;
}

.badge.pending {
  background: #fce7f3;
  color: #be185d;
  border: 1px solid #f472b6;
}

.badge.published {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #4ade80;
}

/* AI Autowrite 반응형 개선 */
@media (max-width: 768px) {
  .mw-grid {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .status-select {
    min-width: 100%;
  }
}

/* =====================================================================
   ADMIN STYLES
   ===================================================================== */

/* === Admin 페이지 레이아웃 최적화 ======================== */
/* AI Settings 페이지 - 너무 넓은 테이블 문제 해결 */
.admin-ai-settings {
  max-width: 100%;
  margin: 0;
  padding: 0 20px;
}

/* 관리자 페이지용 특수 스타일 */
.admin-ai-settings .mw-card {
  max-width: 100%;
  overflow-x: auto;
}

.admin-ai-settings table {
  min-width: 800px;
  width: 100%;
  table-layout: auto;
}

.admin-ai-settings th,
.admin-ai-settings td {
  padding: 8px 12px;
  white-space: nowrap;
  vertical-align: top;
}

.admin-ai-settings .form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #f8f9fa;
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.admin-ai-settings .form-inline label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  font-size: 14px;
  font-weight: 500;
}

.admin-ai-settings .form-inline input,
.admin-ai-settings .form-inline select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  min-width: 150px;
}

/* AI Autowrite 페이지 - 너무 좁은 레이아웃 문제 해결 */
.admin-ai-autowrite {
  max-width: 100%;
  margin: 0;
  padding: 0 20px;
}

/* AI 자동 작성 페이지용 */
.admin-ai-autowrite .mw-card {
  max-width: 100%;
}

.admin-ai-autowrite .mw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-ai-autowrite .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-ai-autowrite .form-group label {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.admin-ai-autowrite .form-group select,
.admin-ai-autowrite .form-group input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fff;
}

.admin-ai-autowrite .mw-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.admin-ai-autowrite .mw-table th,
.admin-ai-autowrite .mw-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}

.admin-ai-autowrite .mw-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: var(--ink);
}

/* 반응형 개선 */
@media (max-width: 1024px) {
  .admin-ai-settings {
    padding: 0 16px;
  }
  
  .admin-ai-settings .form-inline {
    flex-direction: column;
    align-items: stretch;
  }
  
  .admin-ai-settings .form-inline label {
    min-width: auto;
  }
  
  .admin-ai-autowrite {
    padding: 0 16px;
  }
  
  .admin-ai-autowrite .mw-grid {
    grid-template-columns: 1fr;
  }
  
  .admin-ai-topics {
    padding: 0 16px;
  }
}

@media (max-width: 768px) {
  .admin-ai-settings {
    padding: 0 12px;
  }
  
  .admin-ai-settings table {
    min-width: 600px;
  }
  
  .admin-ai-settings th,
  .admin-ai-settings td {
    padding: 6px 8px;
    font-size: 13px;
  }
  
  .admin-ai-autowrite {
    padding: 0 12px;
  }
  
  .admin-ai-topics {
    padding: 0 12px;
  }
}

/* === AI Topics 페이지 레이아웃 ======================== */
.admin-ai-topics {
  max-width: 100%;
  margin: 0;
  padding: 0 20px;
}

/* AI 주제 관리 페이지용 */
.admin-ai-topics .mw-card {
  max-width: 100%;
}

.admin-ai-topics .mw-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.admin-ai-topics .mw-table th,
.admin-ai-topics .mw-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}

.admin-ai-topics .mw-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: var(--ink);
}

.admin-ai-topics .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-ai-topics .form-group label {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.admin-ai-topics .form-group input,
.admin-ai-topics .form-group select,
.admin-ai-topics .form-group textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fff;
}

.admin-ai-topics .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.admin-ai-topics .btn {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-ai-topics .btn:hover {
  background: #f8f9fa;
  border-color: var(--brand);
}

.admin-ai-topics .btn.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand-600);
}

.admin-ai-topics .btn.primary:hover {
  background: var(--brand-600);
}

.admin-ai-topics .btn.danger {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

.admin-ai-topics .btn.danger:hover {
  background: #c82333;
}

/* CSV 업로드 섹션 */
.admin-ai-topics .csv-section {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.admin-ai-topics .csv-section h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: var(--ink);
}

/* 폼 그리드 레이아웃 */
.admin-ai-topics .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-ai-topics .form-grid .full {
  grid-column: 1 / -1;
}

.admin-ai-topics .form-grid .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-ai-topics .form-grid label {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.admin-ai-topics .form-grid input,
.admin-ai-topics .form-grid select,
.admin-ai-topics .form-grid textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.admin-ai-topics .form-grid textarea.notes {
  min-height: 120px;
  line-height: 1.5;
  resize: vertical;
}

/* 반응형 개선 */
@media (max-width: 1024px) {
  .admin-ai-topics {
    padding: 0 16px;
  }
  
  .admin-ai-topics .mw-table {
    font-size: 13px;
  }
  
  .admin-ai-topics .mw-table th,
  .admin-ai-topics .mw-table td {
    padding: 8px 6px;
  }
}

@media (max-width: 768px) {
  .admin-ai-topics {
    padding: 0 12px;
  }
  
  .admin-ai-topics .mw-table {
    overflow-x: auto;
    display: block;
    white-space: nowrap;
  }
  
  .admin-ai-topics .form-actions {
    flex-direction: column;
  }
  
  .admin-ai-topics .form-grid {
    grid-template-columns: 1fr;
  }
}

/* === Content Templates === */
.content-templates-container {
  margin: 24px 0;
}

.template-card {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.template-card:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  transform: translateY(-2px);
  border-color: #1bb2d3;
}

.template-content {
  line-height: 1.6;
  color: #1e293b;
}

.template-content h1,
.template-content h2,
.template-content h3,
.template-content h4,
.template-content h5,
.template-content h6 {
  margin: 0 0 16px 0;
  color: #1e293b;
  font-weight: 600;
}

.template-content p {
  margin: 0 0 16px 0;
  color: #64748b;
}

.template-content a {
  color: #1bb2d3;
  text-decoration: none;
  transition: color 0.3s ease;
}

.template-content a:hover {
  color: #0ea5e9;
  text-decoration: underline;
}

.template-content ul,
.template-content ol {
  margin: 0 0 16px 0;
  padding-left: 20px;
}

.template-content li {
  margin-bottom: 8px;
  color: #64748b;
}

.template-content blockquote {
  margin: 0 0 16px 0;
  padding: 16px 20px;
  background: #f8fafc;
  border-left: 4px solid #1bb2d3;
  border-radius: 0 8px 8px 0;
  color: #475569;
}

.template-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #e11d48;
}

.template-content pre {
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0 0 16px 0;
}

.template-content pre code {
  background: none;
  padding: 0;
  color: #475569;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .template-card {
    padding: 20px;
    margin-bottom: 16px;
  }
  
  .template-content h1,
  .template-content h2,
  .template-content h3 {
    font-size: 20px;
  }
  
  .template-content h4,
  .template-content h5,
  .template-content h6 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .template-card {
    padding: 16px;
    margin-bottom: 12px;
  }
  
  .template-content h1,
  .template-content h2,
  .template-content h3 {
    font-size: 18px;
  }
  
  .template-content h4,
  .template-content h5,
  .template-content h6 {
    font-size: 16px;
  }
}

/* === 하위 카테고리 배지 스타일 === */
.sub-category-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .sub-category-badges {
    gap: 6px;
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .sub-category-badges {
    gap: 4px;
    margin-bottom: 10px;
  }
}

/* === Category subcategory UI (moved from inline in category.php) === */
.subcategory-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.subcategory-btn:hover { background:#e2e8f0; border-color:#cbd5e1; }
.subcategory-buttons { margin-top:16px; width:100%; max-width:100%; box-sizing:border-box; }
.subcategory-buttons-pc { display:flex; flex-wrap:wrap; gap:8px; }
.subcategory-buttons-mobile { display:none; }
.subcategory-select-container { width:100%; max-width:100%; box-sizing:border-box; }
.subcategory-select {
  width:100%; padding:12px 16px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px;
  font-size:14px; color:#475569; cursor:pointer; appearance:none; -webkit-appearance:none; -moz-appearance:none;
  background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat:no-repeat; background-position:right 12px center; background-size:16px; padding-right:40px; box-sizing:border-box; transition:all .2s ease;
}
.subcategory-select:hover { background:#e2e8f0; border-color:#cbd5e1; }
.subcategory-select:focus { outline:none; border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,.1); }
.subcategory-select option { padding:8px; background:#fff; color:#475569; }

@media (min-width: 769px) {
  .subcategory-buttons-mobile { display:none !important; }
}
@media (max-width: 768px) {
  .subcategory-buttons-pc { display:none !important; }
  .subcategory-buttons-mobile { display:block !important; width:100%; max-width:100%; box-sizing:border-box; }
}
@media (max-width: 320px) {
  .subcategory-select { padding:10px 12px; font-size:13px; padding-right:36px; background-size:14px; }
}

/* =====================================================================
   Page Common Styles (공통 페이지 스타일)
   ===================================================================== */

/* === 유틸리티 클래스 === */
.flex-1 { flex: 1; }
.min-width-0 { min-width: 0; }
.flex-shrink-0 { flex-shrink: 0; }