/* ===================================
   기본 리셋 및 전역 설정
=================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    background-color: #f5f7fa;
    color: #333;
}

/* ===================================
   헤더 및 네비게이션
=================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    border-radius: 6px;
}

.category-nav {
    display: flex;
    gap: 30px;
}

.category-nav a {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    font-size: 15px;
    padding: 12px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.category-nav a:hover {
    color: #000;
}

.category-nav a.active {
    color: #000;
    background: transparent;
    border-color: transparent;
    backdrop-filter: none;
    box-shadow: none;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
}

/* ===================================
   사이트 헤더 (제목/설명)
=================================== */
.site-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    text-align: center;
    padding: 30px 30px 20px 30px;
    margin-top: 70px;
    border-bottom: 1px solid #e0f2fe;
}

.site-title {
    font-size: 28px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.site-description {
    font-size: 16px;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.4;
}

/* ===================================
   메인 컨테이너
=================================== */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 30px;
    background: #f5f7fa;
    min-height: calc(100vh - 200px);
}

.post-content .main-container,
body:has(.post-content) .main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 30px;
    background: #f5f7fa;
    min-height: calc(100vh - 200px);
}

.back-link {
    display: none;
}

/* ===================================
   소제목 스타일 (h2, h3)
=================================== */
.post-content h2 {
    border-left: 4px solid #333;
    padding-left: 15px;
    padding: 10px 15px;
    margin: 20px 0;
    font-size: 18px;
    font-weight: bold;
}

h3 {
   padding-bottom: 4px;
   margin: 20px 0 -10px 0;
   font-size: 16px;
   font-weight: 600;
   color: #333;
   position: relative;
}

h3::before {
   content: '• ';
   color: #333;
   margin-right: 4px;
}

/* 센터 정렬된 h2 스타일 - 그라데이션 라인 */
.post-content h2[style*="text-align: center"] {
    border-left: none !important;
    border-top: none !important;
    background-color: transparent !important;
    text-align: center !important;
    position: relative !important;
    padding: 15px 0 20px 0 !important;
    margin: 30px auto !important;
    width: fit-content !important;
    max-width: 80% !important;
}

.post-content h2[style*="text-align: center"]::before {
    display: none;
}

.post-content h2[style*="text-align: center"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(to right, transparent, #4285f4, transparent);
}

/* 센터 정렬된 h3 스타일 - 그라데이션 라인 */
.post-content h3[style*="text-align: center"] {
    text-align: center !important;
    position: relative !important;
    padding: 15px 0 20px 0 !important;
    margin: 25px auto !important;
    width: fit-content !important;
    max-width: 80% !important;
}

.post-content h3[style*="text-align: center"]::before {
    display: none !important;
}

.post-content h3[style*="text-align: center"]::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 80px !important;
    height: 2px !important;
    background: linear-gradient(to right, transparent, #26a69a, transparent) !important;
}

/* ===================================
   버튼 스타일
=================================== */
.common-btn {
    margin: 20px 0;
    text-align: center;
    width: 100%;
}

.btn {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #ff4757 0%, #d63031 100%);
    background-size: 200% 200%;
    background-position: 0% 50%;
    color: white;
    padding: 18px 30px;
    text-decoration: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 18px;
    border: none;
    cursor: pointer;
    transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
    background-position: 100% 50%;
}

.btn:active {
    transform: translateY(0);
    transition: all 0.1s ease;
}

.mobile-only-btn {
    display: none;
}

/* 모바일 버튼 스타일 추가 */
.mobile-btn {
    background: linear-gradient(135deg, #ff4757 0%, #d63031 100%);
    background-size: 200% 200%;
    background-position: 0% 50%;
    color: white;
    padding: 18px 30px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px !important;
    font-weight: bold;
    display: block;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
    transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-btn:hover {
    background-position: 100% 50%;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

/* ===================================
   표 스타일
=================================== */
table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 20px 0 !important;
    border: 1px solid #ddd !important;
}

th {
    background-color: #f0f0f0 !important;
    border: 1px solid #ddd !important;
    padding: 12px !important;
    text-align: center !important;
    font-weight: bold !important;
    font-size: 15px !important;
}

td {
    border: 1px solid #ddd !important;
    padding: 12px !important;
    text-align: center !important;
    font-size: 14px !important;
}

/* ===================================
   FAQ 아코디언
=================================== */
.faq-section {
  margin: 20px 0;
  padding: 0;
}

.faq-container {
  background: transparent;
  border-radius: 8px;
  overflow: visible;
  border: 1px solid rgba(0, 0, 0, 0.2);
  margin: 20px 0;
}

.faq-item {
  background: transparent;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item:hover {
  background: transparent;
}

.faq-question {
  background: transparent;
  color: #374151;
  padding: 18px 22px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.faq-question:hover {
  background: white;
  border: 1px solid #333;
  color: #333;
}

.faq-question.active {
  background: white;
  border: 1px solid #333;
  color: #333;
}

.faq-question::after {
  content: '';
  width: 10px;
  height: 10px;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: rotate(45deg);
  transition: all 0.2s ease;
}

.faq-question.active::after {
  transform: rotate(225deg);
  border-color: #333;
}

.faq-answer {
  background: transparent;
  color: #4b5563;
  line-height: 1.6;
  display: none;
  padding: 20px 24px;
  border-top: 1px solid #f3f4f6;
}

.faq-answer.active {
  display: block;
}

.faq-answer p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
}

/* ===================================
   마무리글 박스
=================================== */
.conclusion-box {
  margin: 20px 0;
  padding: 0;
}

.conclusion-content {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 18px;
  border-radius: 8px;
  margin: 20px 0;
}

.conclusion-title {
  color: rgba(0, 0, 0, 0.8);
  font-size: 16px;
  font-weight: bold;
  margin: 0 0 10px 0;
}

.conclusion-title::before {
  content: "💡 ";
  margin-right: 0;
}

.conclusion-content p {
  color: #495057;
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  font-weight: 500;
}

/* ===================================
   Info Box 스타일
=================================== */
.info-box {
  margin: 20px 0;
  padding: 0;
}

.info-content {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 18px;
  border-radius: 8px;
  margin: 20px 0;
}

.info-title {
  color: rgba(0, 0, 0, 0.8);
  font-size: 16px;
  font-weight: bold;
  margin: 0 0 12px 0;  
}

.info-title::before {
  content: "🔥 ";
  margin-right: 0;
}

.info-content p {
  color: #495057;
  font-size: 16px !important;
  line-height: 1.5;
  margin: 0;
  font-weight: bold;
}

.info-list {
  color: #495057 !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  font-weight: 500 !important;
}

/* 주의사항용 색상 변형 */
.info-box.warning .info-content {
  border-color: rgba(0, 0, 0, 0.2);
}

.info-box.warning .info-title {
  color: rgba(0, 0, 0, 0.8);
}

.info-box.warning .info-title::before {
  content: "⚠️ ";
  margin-right: 0;
}

/* 절차안내용 색상 변형 */
.info-box.guide .info-content {
  border-color: rgba(0, 0, 0, 0.2);
}

.info-box.guide .info-title {
  color: rgba(0, 0, 0, 0.8);
}

.info-box.guide .info-title::before {
  content: "📝 ";
  margin-right: 0;
}


/* ===================================
   내부링크 섹션
=================================== */
.internal-links-section {
 text-align: center;
 margin: 20px 0;
 padding: 0;
 max-width: none;
}

.internal-links-box {
 background: transparent !important;
 border: 1px solid rgba(0, 0, 0, 0.2);
 border-radius: 16px;
 padding: 25px;
 position: relative;
}

.internal-links-title {
 margin: 0 0 24px 0;
 color: #111827;
 font-size: 18px;
 font-weight: 700;
 text-align: center;
 padding-bottom: 12px;
 border-bottom: 2px solid #f3f4f6;
}

.internal-links-list {
 display: flex;
 flex-direction: column;
 gap: 12px;
 max-width: 600px;
 margin: 0 auto;
}

.internal-link {
 display: block;
 padding: 16px 20px;
 background: transparent;
 border: 1px solid rgba(0, 0, 0, 0.15);
 border-radius: 10px;
 text-decoration: none;
 color: #333;
 transition: all 0.3s ease;
 font-size: 15px;
 font-weight: 500;
 text-align: center;
 position: relative;
 box-shadow: none;
}

.internal-link::before {
 content: '';
 width: 6px;
 height: 6px;
 background: #d1d5db;
 border-radius: 50%;
 margin-right: 12px;
 transition: all 0.2s ease;
}

.internal-link::after {
 content: '→';
 margin-left: auto;
 color: #d1d5db;
 font-weight: 600;
 transition: all 0.2s ease;
}

.internal-link:hover {
 background: white;
 border-color: #333;
 color: #333;
 transform: none;
 box-shadow: none;
}

.internal-link:hover::before {
 background: #333;
}

.internal-link:hover::after {
 color: #333;
}

/* ===================================
   글 목록 스타일 (현대적으로 개선)
=================================== */
.posts-list {
    list-style: none;
}

.post-item {
    display: flex;
    background: white !important;
    border-radius: 16px;
    margin-bottom: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e1e8ed;
    padding: 25px;
    flex-direction: row-reverse;
    gap: 20px;
    align-items: center;
}

.post-item:hover {
    background: #f8fafc !important;
    border-color: #333;
}

.post-content-area {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-category {
    display: inline-block;
    background: transparent;
    color: #333;
    padding: 0;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    width: fit-content;
}

.post-category::before {
    content: '#';
    margin-right: 2px;
}

.posts-list .post-title {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50 !important;
    margin-bottom: 12px;
    line-height: 1.4;
    letter-spacing: -0.3px;
    word-break: break-word;
    overflow-wrap: break-word;
    border-left: none !important;
    padding-left: 0 !important;
    transition: color 0.3s ease !important;
}

.posts-list .post-title a {
    color: inherit !important;
    text-decoration: none;
}

.post-item:hover .post-title,
.post-item:hover .post-title a {
    color: #333 !important;
}

.post-excerpt {
    color: #7f8c8d;
    font-size: 15px;
    line-height: 1.7;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 12px;
}

.post-date {
    color: #95a5a6;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.post-date::before {
    content: "📅 ";
    margin-right: 5px;
}

.post-thumbnail {
    flex-shrink: 0;
    width: 240px;
    height: auto;
    min-height: 140px;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3498db;
    font-weight: 500;
    order: 2;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.post-item.no-image .post-thumbnail {
    display: none;
}

/* ===================================
   개별 글 내용 스타일
=================================== */
.post-content {
    background: transparent;
    padding: 0;
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}

.post-content p {
    font-size: 16px !important;
    margin: 10px 0;
    line-height: 1.8;
}

.post-content ul, .post-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0;
}

.post-content video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    display: block;
}

/* ===================================
   이미지/동영상 크기 조절 클래스
=================================== */
.post-content .img-small {
    width: 300px;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
}

.post-content .img-medium {
    width: 500px;
    max-width: 500px;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
}

.post-content .img-large {
    width: 90%;
    max-width: 90%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
}

.post-content .img-full {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
    box-sizing: border-box;
}

.post-content .img-left {
    float: left;
    max-width: 300px;
    margin: 0 20px 20px 0;
    border-radius: 8px;
}

.post-content .img-right {
    float: right;
    max-width: 300px;
    margin: 0 0 20px 20px;
    border-radius: 8px;
}

.post-content .img-center {
    display: block;
    margin: 20px auto;
    max-width: 600px;
    border-radius: 8px;
}

/* ===================================
   동영상 컨테이너 크기 제어
=================================== */
.post-content div[style*="max-width"] .video-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-bottom: 56.25% !important;
    height: 0 !important;
    position: relative !important;
    overflow: hidden !important;
    border-radius: 8px !important;
}

.post-content div[style*="max-width"] .video-container iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 8px !important;
}

.post-content div[style*="300px"] {
    max-width: 300px !important;
    width: 300px !important;
}

.post-content div[style*="500px"] {
    max-width: 500px !important;
    width: 500px !important;
}

.post-content div[style*="800px"] {
    max-width: 90% !important;
    width: 90% !important;
}

.post-content .video-container.video-small,
.post-content div[class*="video-container"][class*="video-small"] {
    max-width: 300px !important;
    width: 300px !important;
    margin: 20px 0 !important;
    display: block !important;
}

.post-content .video-container.video-medium,
.post-content div[class*="video-container"][class*="video-medium"] {
    max-width: 500px !important;
    width: 500px !important;
    margin: 20px 0 !important;
    display: block !important;
}

.post-content .video-container.video-large,
.post-content div[class*="video-container"][class*="video-large"] {
    max-width: 800px !important;
    width: 800px !important;
    margin: 20px 0 !important;
    display: block !important;
}

.post-content .video-container.video-full,
.post-content div[class*="video-container"][class*="video-full"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 20px 0 !important;
    display: block !important;
}

.post-content .video-container.video-left,
.post-content div[class*="video-container"][class*="video-left"] {
    float: left !important;
    max-width: 300px !important;
    margin: 0 20px 20px 0 !important;
}

.post-content .video-container.video-right,
.post-content div[class*="video-container"][class*="video-right"] {
    float: right !important;
    max-width: 300px !important;
    margin: 0 0 20px 20px !important;
}

.post-content .video-container.video-center,
.post-content div[class*="video-container"][class*="video-center"] {
    display: block !important;
    margin: 20px auto !important;
    max-width: 600px !important;
}

.post-content video.video-small {
    max-width: 300px !important;
    width: 300px !important;
    height: auto !important;
    display: block !important;
}

.post-content video.video-medium {
    max-width: 500px !important;
    width: 500px !important;
    height: auto !important;
    display: block !important;
}

.post-content video.video-large {
    max-width: 800px !important;
    width: 800px !important;
    height: auto !important;
    display: block !important;
}

.post-content video.video-full {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
}

.post-content video.video-left {
    float: left !important;
    max-width: 300px !important;
    margin: 0 20px 20px 0 !important;
}

.post-content video.video-right {
    float: right !important;
    max-width: 300px !important;
    margin: 0 0 20px 20px !important;
}

.post-content video.video-center {
    display: block !important;
    margin: 20px auto !important;
    max-width: 600px !important;
}

/* ===================================
   이미지 격자 스타일
=================================== */
.image-grid-2, .image-grid-3 {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    width: 100%;
    align-items: flex-start;
    overflow: hidden;
}

.image-grid-2 > div,
.image-grid-3 > div {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.image-grid-2 > div {
    width: calc(50% - 5px) !important;
    max-width: calc(50% - 5px) !important;
    min-width: calc(50% - 5px) !important;
    flex: 0 0 calc(50% - 5px) !important;
    box-sizing: border-box !important;
}

.image-grid-3 > div {
    width: calc(33.333% - 7px) !important;
    max-width: calc(33.333% - 7px) !important;
    min-width: calc(33.333% - 7px) !important;
    flex: 0 0 calc(33.333% - 7px) !important;
    box-sizing: border-box !important;
}

.image-grid-2 .video-container,
.image-grid-3 .video-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-bottom: 56.25% !important;
    height: 0 !important;
    position: relative !important;
    overflow: hidden !important;
}

.image-grid-2 .video-container iframe,
.image-grid-3 .video-container iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.image-grid-2 img,
.image-grid-3 img,
.image-grid-2 video,
.image-grid-3 video,
.image-grid-2 .video-container,
.image-grid-3 .video-container {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    border-radius: 8px;
    display: block;
    object-fit: cover;
    margin: 0 0 8px 0;
    box-sizing: border-box;
}

.image-grid-2 p,
.image-grid-3 p {
    margin: 0 !important;
    padding: 0;
    font-size: 12px !important;
    color: #666 !important;
    text-align: center !important;
    line-height: 1.4 !important;
}

/* ===================================
   자동 목차 생성기
=================================== */
.auto-toc {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 25px;
    margin: 20px auto !important;
    position: relative;
    width: 100% !important;
    max-width: none !important;
    display: block !important;
    float: none !important;
    clear: both !important;
    text-align: left !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

.toc-title {
    margin: 0 0 20px 0;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-h2 {
    margin-bottom: 8px;
}

.toc-h2 > a {
    display: block;
    color: #333;
    text-decoration: none;
    padding: 15px 20px;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
    margin-left: -30px;
}

.toc-h2 > a:hover {
    color: #333;
}

.toc-h2 > a.active {
    color: #333;
    font-weight: 600;
}

/* ===================================
   따라오는 목차 (PC전용)
=================================== */
.floating-toc {
    position: fixed;
    left: 10px;
    top: 210px;
    transform: none;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(66, 133, 244, 0.15);
    border-radius: 6px;
    padding: 8px 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    z-index: 999;
    max-height: 50vh;
    overflow-y: auto;
    width: 180px;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.floating-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.floating-toc-item {
    position: relative;
    margin: 0;
}

.floating-toc-item > a {
    display: block;
    padding: 8px 15px;
    color: #b8bcc8;
    text-decoration: none;
    font-size: 12px;
    line-height: 0.5;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.floating-toc-item > a:hover {
    color: #000000;
}

.floating-toc-item > a.active {
    color: #333;
    font-weight: 600;
}

.floating-toc::-webkit-scrollbar {
    width: 4px;
}

.floating-toc::-webkit-scrollbar-track {
    background: transparent;
}

.floating-toc::-webkit-scrollbar-thumb {
    background: rgba(66, 133, 244, 0.3);
    border-radius: 2px;
}

.floating-toc::-webkit-scrollbar-thumb:hover {
    background: rgba(66, 133, 244, 0.5);
}

/* ===================================
   페이지네이션
=================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 60px 0 40px 0;
}

.pagination a,
.pagination span {
    padding: 12px 18px;
    background: white;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: #64748b;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.pagination a:hover {
    background: #333;
    color: white;
    border-color: #333;
    transform: translateY(-1px);
}

.pagination .current {
    background: #333;
    color: white;
    border-color: #333;
}

/* ===================================
   빈 상태
=================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ===================================
   광고 컨테이너 (원본 유지)
=================================== */
.ad-top,
.ad-middle,
.ad-bottom {
    margin: 20px 0;
    text-align: center;
    min-width: 320px;
}

.ad-top:empty,
.ad-middle:empty,
.ad-bottom:empty {
    display: none;
    margin: 0;
}

/* 메인 인덱스 페이지 광고 센터 정렬 강제 */
body.index-page .main-wrapper .ad-top,
body.index-page .main-wrapper .ad-middle,
body.index-page .main-wrapper .ad-bottom,
body.index-page .main-content .ad-top,
body.index-page .main-content .ad-middle,
body.index-page .main-content .ad-bottom {
    text-align: center !important;
    margin: 20px auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    display: block !important;
}

body.index-page .main-wrapper .adsbygoogle,
body.index-page .main-content .adsbygoogle {
    margin: 0 auto !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

    .legacy-ad-container {
        margin: 15px 0;
        text-align: center;
    }

    .legacy-ad-container:empty {
        display: none;
        margin: 0;
    }

.sidebar-ad {
    position: fixed;
    top: 56%;
    transform: translateY(-50%);
    min-width: 160px;    
    min-height: 600px;  
    z-index: 999;
}

.left-sidebar {
    left: 200px;
}

.right-sidebar {
    right: 200px;
}

/* ===================================
   푸터
=================================== */
.footer {
    background: #1e293b;
    color: white;
    text-align: center;
    padding: 20px 20px;
    position: relative;
    z-index: 9999 !important;
    margin-bottom: 0 !important;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.footer-text {
    font-size: 14px;
    line-height: 1.8;
    color: #94a3b8;
    text-align: center;
}

.social-links {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #94a3b8;
    transition: color 0.3s;
}

.social-links a:hover {
    color: white;
}

.social-links img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

/* ===================================
   기타 유틸리티
=================================== */
div[style*="position: fixed"][style*="bottom: 0"] {
    bottom: 0 !important;
    margin-bottom: 0 !important;
}

body {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* 출처 표기 스타일 */
.source {
    color: #666;
    font-size: 13px;
    font-style: italic;
    margin-left: 5px;
    opacity: 0.8;
}

/* 형광펜 효과 */
.post-content .mark,
.mark,
mark {
    background: linear-gradient(180deg, transparent 60%, rgba(255, 235, 59, 0.4) 60%) !important;
    padding: 1px 0 !important;
    color: #333 !important;
}

/* ===================================
   모바일 반응형 디자인
=================================== */
@media (max-width: 768px) {
    /* 네비게이션 */
    .top-nav {
        padding: 12px 20px;
        position: relative;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .category-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        border-radius: 0 0 12px 12px;
        padding: 20px;
        z-index: 1001;
    }
    
    .category-nav.show {
        display: flex;
    }
    
    .category-nav a {
        padding: 12px 16px;
        border-radius: 8px;
        margin-bottom: 8px;
    }
    
    /* 헤더 */
    .site-header {
        padding: 20px 20px;
        margin-top: 70px;
    }
    
    .site-title {
        font-size: 20px;
        line-height: 1.3;
        word-break: keep-all;
        overflow-wrap: break-word;
    }
    
    .site-description {
        font-size: 14px;
        line-height: 1.4;
        word-break: keep-all;
        overflow-wrap: break-word;
    }
    
    /* 메인 컨테이너 */
    .main-container {
        padding: 40px 15px; /* 15px에서 5px로 */
    }
    
    /* 이 부분 추가 */
    main.main-container {
        padding: 20px 1px !important; /* 개별 글 페이지용 */
    }
    
    /* 소제목 폰트 조정 */
    .post-content h2 {
        font-size: 14px !important;
        padding: 10px 15px;
    }
    
    h3 {
        font-size: 13px;
        margin: 20px 0 -10px 0;
    }
    
    h3::after {
        height: 1.5px;
    }
    
    /* 본문 폰트 */
    .post-content p {
        font-size: 12px !important;
    }
    
    /* 버튼 */
    .btn {
        padding: 20px 25px;
        font-size: 14px !important;
    }
    
    .mobile-only-btn {
        display: block;
        margin: 25px 0;
        text-align: center;
    }
    
    /* 표 */
    table, table *, 
    table th, table td,
    thead th, tbody td,
    .post-content table,
    .post-content table *,
    .post-content table th,
    .post-content table td,
    .container table,
    .container table *,
    .container table th,
    .container table td {
        font-size: 11px !important;
        line-height: 1.4 !important;
    }
    
    th, table th, thead th {
        padding: 8px 6px !important;
    }
    
    td, table td, tbody td {
        padding: 8px 6px !important;
    }
    
    table {
        -webkit-text-size-adjust: none !important;
        text-size-adjust: none !important;
    }
    
    table * {
        -webkit-text-size-adjust: none !important;
        text-size-adjust: none !important;
        max-height: none !important;
        min-height: auto !important;
    }
    
    /* FAQ */
    .faq-question {
        font-size: 12px !important;
    }
    
    /* 마무리글 */
    .conclusion-content {
        padding: 20px;
    }
    
    .conclusion-title {
        font-size: 13px;
    }
    
    .conclusion-title::before {
        margin-right: 0;
    }
    
    .conclusion-content p {
        font-size: 12px;
    }
    
    /* Info Box */
    .info-content {
        padding: 15px;
    }
    
    .info-title {
        font-size: 13px;
        margin: 0 0 8px 0; 
    }
    
    .info-title::before,
    .info-box.warning .info-title::before,
    .info-box.guide .info-title::before {
        margin-right: 0;
    }
    
    .info-content p {
        font-size: 12px !important;
        line-height: 1.4 !important;
    }

    .info-list {
      font-size: 12px !important;
      line-height: 1.3 !important;
    }


    /* 목차 */
    .auto-toc {
        padding: 20px;
        margin: 20px 0;
    }
    
    .toc-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .toc-h2 > a {
        padding: 12px 15px;
        font-size: 12px !important;
    }
    
    .floating-toc {
        display: none !important;
    }
    
    /* 내부링크 */
    .internal-links-section {
        margin: 20px 0;
        padding: 0;
    }
    
    .internal-links-box {
        padding: 20px;
        border-radius: 12px;
    }
    
    .internal-links-title {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .internal-links-list {
        gap: 10px;
        max-width: 100%;
    }
    
    .internal-link {
        padding: 14px 16px;
        font-size: 12px !important;
        border-radius: 8px;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block !important;    
    }
    
    /* 글 목록 모바일 최적화 */
    .post-item {
        flex-direction: column !important;
        padding: 20px;
        border-radius: 12px;
    }
    
    .post-thumbnail {
        width: 100%;
        height: auto;
        min-height: 140px;
        order: 0;
        border-radius: 10px;
    }
    
    .post-content-area {
        padding: 15px 0 0 0;
    }
    
    .posts-list .post-title {
        font-size: 20px;
    }
    
    .post-category {
        padding: 6px 14px;
        font-size: 12px;
    }
    
    .post-excerpt {
        font-size: 14px;
    }
    
    /* 광고 모바일 최적화 (원본 유지) */
    .ad-top,
    .ad-middle,
    .ad-bottom {
        margin: 20px auto;
        padding: 0;
        text-align: center;
        width: calc(100vw - 30px) !important;
        max-width: calc(100vw - 30px) !important;
        overflow: hidden;
    }

    .ad-top .adsbygoogle,
    .ad-middle .adsbygoogle,
    .ad-bottom .adsbygoogle {
        display: block !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden;
    }



    body.index-page .main-wrapper .ad-top,
    body.index-page .main-wrapper .ad-middle,
    body.index-page .main-wrapper .ad-bottom,
    body.index-page .main-content .ad-top,
    body.index-page .main-content .ad-middle,
    body.index-page .main-content .ad-bottom {
        text-align: center !important;
        margin: 20px auto !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        display: block !important;
    }

    body.index-page .main-wrapper .adsbygoogle,
    body.index-page .main-content .adsbygoogle {
        margin: 0 auto !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }
   
   .legacy-ad-container {
       padding: 0 15px;
       margin: 20px 0;
       text-align: center;
       max-width: 100%;
       overflow: hidden;
   }
   
   .legacy-ad-container .adsbygoogle {
       display: block !important;
       margin: 0 auto !important;
       max-width: 100% !important;
       width: 100% !important;
   }
    
    .sidebar-ad {
        display: none;
    }
    
    /* 이미지/동영상 */
    .post-content img, .post-content video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        margin: 15px 0;
        border-radius: 5px;
        float: none !important;
        display: block !important;
    }
    
    .post-content .img-small, .post-content .video-small,
    .post-content .img-medium, .post-content .video-medium,
    .post-content .img-large, .post-content .video-large,
    .post-content .img-full, .post-content .video-full,
    .post-content .img-left, .post-content .video-left,
    .post-content .img-right, .post-content .video-right,
    .post-content .img-center, .post-content .video-center {
        max-width: 100% !important;
        width: 100% !important;
        float: none !important;
        margin: 15px auto !important;
        display: block !important;
    }
    
    .post-content .video-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 15px auto !important;
    }
    
    .post-content .video-container.video-small,
    .post-content .video-container.video-medium,
    .post-content .video-container.video-large {
        max-width: 100% !important;
        width: 100% !important;
    }

    .post-content div[style*="300px"],
    .post-content div[style*="500px"],
    .post-content div[style*="800px"],
    .post-content video[style*="300px"],
    .post-content video[style*="500px"],
    .post-content video[style*="800px"] {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* 이미지 격자 */
    .image-grid-2 {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px;
        margin: 15px 0;
    }
    
    .image-grid-3 {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px;
        margin: 15px 0;
    }
    
    .image-grid-2 > div {
        flex: 1 !important;
        width: calc(50% - 4px) !important;
        max-width: calc(50% - 4px) !important;
        min-width: calc(50% - 4px) !important;
        flex-basis: calc(50% - 4px) !important;
    }
    
    .image-grid-3 > div {
        flex: none !important;
        width: calc(33.333% - 6px) !important;
        max-width: calc(33.333% - 6px) !important;
        min-width: calc(33.333% - 6px) !important;
        flex-basis: calc(33.333% - 6px) !important;
    }
    
    .image-grid-2 img,
    .image-grid-3 img,
    .image-grid-2 video,
    .image-grid-3 video {
        width: 100% !important;
        height: auto;
        object-fit: cover;
        aspect-ratio: 4/3;
    }
    
    .image-grid-2 .video-container,
    .image-grid-3 .video-container {
        width: 100% !important;
        padding-bottom: 56.25% !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    .image-grid-2 .video-container iframe,
    .image-grid-3 .video-container iframe {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    .image-grid-2 p,
    .image-grid-3 p {
        font-size: 11px !important;
        margin-top: 4px !important;
    }
    
    /* 푸터 */
    .social-links {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        justify-content: center;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid #374151;
    }
    
    .social-links img {
        width: 20px;
        height: 20px;
    }
    
    /* 기타 */
    .source {
        font-size: 12px;
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }
    
    .container {
        padding: 5px;
        margin: 0px;
    }
    
    .post-content {
        font-size: 16px;
        padding: 0;
    }
    
    /* 페이지네이션 모바일 최적화 */
    .pagination {
        gap: 4px;
        margin: 40px 0 30px 0;
    }
    
    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 40px;
        text-align: center;
        border-radius: 6px;
    }
}

/* PC에서만 표시 (1024px 이상) */
@media (min-width: 1024px) {
    .floating-toc {
        display: block;
    }
    
    .post-content div[style*="800px"] {
        max-width: 90% !important;
        width: 90% !important;
    }
}

/* 좁은 화면에서 목차 조정 */
@media (max-width: 1200px) {
    .floating-toc {
        left: 30px;
        min-width: 140px;
        max-width: 160px;
    }
    
    .floating-toc-item > a {
        font-size: 10px;
        padding: 5px 10px;
    }
}

@media (max-width: 1023px) {
    .floating-toc {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .internal-links-box {
        padding: 18px 15px;
    }
    
    .internal-link {
        padding: 12px 14px;
        font-size: 12px !important;           
        white-space: nowrap !important;       
        overflow: hidden !important;          
        text-overflow: ellipsis !important;   
        display: block !important;           
    }
}

/* === 뉴스 스타일 레이아웃 === */
        .main-wrapper {
            max-width: 1200px;
            margin: 0 auto;
            padding: 30px 20px;
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 10px;
        }

        .main-content {
            background: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        }

        .featured-section {
            padding: 25px;
            border-bottom: 1px solid #e5e7eb;
            overflow: hidden;
        }

        .news-section-title {
            font-size: 20px;
            font-weight: 700;
            color: #333;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid #333;
        }

        .featured-main {
            display: flex;
            gap: 20px;
            margin-bottom: 30px;
            cursor: pointer;
            transition: all 0.3s ease;
        }


        .featured-main-image {
            width: 300px;
            height: 200px;
            background: #e5e7eb;
            border-radius: 8px;
            overflow: hidden;
            position: relative;
        }

        .featured-main-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .featured-main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .featured-main-title {
            font-size: 22px;
            font-weight: 700;
            color: #1f2937;
            line-height: 1.4;
            margin-bottom: 10px;
        }

        .featured-main-excerpt {
            color: #6b7280;
            font-size: 14px;
            line-height: 1.6;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .featured-sub {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }

        .featured-item {
            display: flex;
            gap: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            padding: 10px;
            border-radius: 8px;
        }

        .featured-item:hover {
            background: #f1f5f9 !important;
            border-radius: 8px;
        }


        .featured-item-image {
            width: 80px;
            height: 60px;
            background: #e5e7eb;
            border-radius: 6px;
            overflow: hidden;
            flex-shrink: 0;
        }

        .featured-item-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .featured-item-content {
            flex: 1;
        }

        .featured-item-title {
            font-size: 14px;
            font-weight: 600;
            color: #374151;
            line-height: 1.4;
            margin-bottom: 5px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .featured-item-excerpt {
            color: #9ca3af;
            font-size: 12px;
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        /* 카테고리 섹션 */
        .category-sections {
            padding: 25px;
        }

        .category-grid {
            display: grid;
            gap: 25px;
        }

        /* 카테고리 개수에 따른 그리드 */
        .category-grid.cols-1 { grid-template-columns: 1fr; }
        .category-grid.cols-2 { grid-template-columns: 1fr 1fr; }
        .category-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

        .category-box {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            overflow: hidden;
        }

        .category-header {
            background: #f9fafb;
            padding: 15px;
            border-bottom: 1px solid #e5e7eb;
        }

        .category-title {
            font-size: 16px;
            font-weight: 700;
            color: #1e40af;
        }

        .category-posts {
            padding: 15px;
        }

        .category-post {
            display: flex;
            gap: 10px;
            padding: 8px 0;
            border-bottom: 1px solid #f3f4f6;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .category-post:last-child {
            border-bottom: none;
        }

        .category-post:hover {
            background: #f9fafb;
            margin: 0 -10px;
            padding: 8px 10px;
            border-radius: 6px;
        }

        .category-post-image {
            width: 50px;
            height: 40px;
            background: #e5e7eb;
            border-radius: 4px;
            overflow: hidden;
            flex-shrink: 0;
        }

        .category-post-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .category-post-content {
            flex: 1;
        }

        .category-post-title {
            font-size: 13px;
            font-weight: 600;
            color: #374151;
            line-height: 1.3;
            margin-bottom: 3px;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .category-post-excerpt {
            color: #9ca3af;
            font-size: 11px;
            line-height: 1.3;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        /* 사이드바 */
        .sidebar {
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
            height: fit-content;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .sidebar-section {
            border-bottom: 1px solid #e5e7eb;
        }

        .sidebar-section:last-child {
            border-bottom: none;
        }

        .sidebar-header {
            padding: 20px;
            border-bottom: 1px solid #e5e7eb;
            background: #f9fafb;
        }

        .sidebar-title {
            font-size: 16px;
            font-weight: 700;
            color: #1f2937;
        }

        .sidebar-content {
            padding: 0;
        }

        .sidebar-post {
            display: flex;
            gap: 12px;
            padding: 15px 20px;
            border-bottom: 1px solid #f3f4f6;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .sidebar-post:last-child {
            border-bottom: none;
        }

        .sidebar-post-image {
            width: 60px;
            height: 45px;
            background: #e5e7eb;
            border-radius: 6px;
            overflow: hidden;
            flex-shrink: 0;
        }

        .sidebar-post-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .sidebar-post-content {
            flex: 1;
        }

        .sidebar-post-title {
            font-size: 14px;
            font-weight: 600;
            color: #374151;
            line-height: 1.4;
            margin-bottom: 5px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .sidebar-post-excerpt {
            color: #9ca3af;
            font-size: 11px;
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        /* 모바일 반응형 */
        @media (max-width: 1024px) {
            .main-wrapper {
                grid-template-columns: 1fr;
                max-width: 800px;
            }
            
            .category-grid {
                grid-template-columns: 1fr !important;
            }
            
            .featured-sub {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .main-wrapper {
                padding: 20px 0px;
                gap: 20px;
            }
            
            .featured-section,
            .category-sections {
                padding: 20px 10px;
            }
            
            .featured-main {
                flex-direction: column;
            }
            
            .featured-main-image {
                width: 100%;
                height: 200px;
            }
            
            .featured-sub {
                gap: 15px;
            }
            
            .sidebar-header,
            .sidebar-post {
                padding: 15px;
            }
            
            .news-section-title {
                font-size: 18px;
            }
        }

/* 전체 글 목록 섹션 스타일 조정 */
.posts-list-section {
    padding: 25px;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .posts-list-section {
        padding: 20px 15px;
    }
}

/* 사이드바 스크롤 설정 */
.main-wrapper {
    align-items: flex-start;
}

.sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* 모바일 페이지네이션 수정 */
@media (max-width: 768px) {
    .pagination {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 4px !important;
        margin: 40px 0 30px 0 !important;
        flex-wrap: wrap !important;
    }
    
    .pagination a,
    .pagination span {
        padding: 8px 12px !important;
        font-size: 14px !important;
        min-width: 40px !important;
        text-align: center !important;
        border-radius: 6px !important;
        background: white !important;
        border: 1px solid #e2e8f0 !important;
        color: #64748b !important;
        text-decoration: none !important;
        box-sizing: border-box !important;
        display: inline-block !important;
    }
    
    .pagination .current {
        background: #2563eb !important;
        color: white !important;
        border-color: #2563eb !important;
    }
    
    .pagination a:hover {
        background: #f8fafc !important;
    }
}

/* 사이드바 글 목록 hover 개선 */
.sidebar-post:hover {
    background: #e2e8f0 !important;
}


/* 오늘의 인기글 섹션 hover 개선 */
.featured-main:hover {
    background: #f1f5f9 !important;
    border-radius: 8px;
    overflow: hidden !important;
}

/* 오늘의 인기글 부드러운 전환 효과 */
.featured-main-title,
.featured-main-excerpt,
.featured-main-image img {
    transition: all 0.5s ease-in-out;
}

.featured-main {
    position: relative;
    overflow: hidden;
}

.featured-main-content {
    transition: opacity 0.5s ease-in-out;
}

.featured-main-image {
    transition: opacity 0.5s ease-in-out;
}

/* 간단한 슬라이드 효과 */
.featured-main {
    transition: transform 0.5s ease-in-out;
}
/* 모바일에서 슬라이드 오버플로우 방지 */
@media (max-width: 768px) {
    .featured-section {
        overflow: hidden !important;
    }
    
    .main-content {
        overflow: hidden !important;
    }
    
    .main-wrapper {
        overflow: hidden !important;
    }
}
/* 오늘의 인기글 고정 높이 - 디스크립션만 확장 */
.featured-main {
    min-height: 200px !important;
    height: 200px !important;
}

.featured-main-content {
    height: 100% !important;
    justify-content: center !important;
}

.featured-main-title {
    height: 60px !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

.featured-main-excerpt {
    height: 90px !important; /* 60px에서 90px로 증가 */
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 4 !important; /* 3줄에서 4줄로 증가 */
    -webkit-box-orient: vertical !important;
}

/* 모바일 고정 높이 */
@media (max-width: 768px) {
    .featured-main {
        min-height: 280px !important;
        height: 280px !important;
    }
    
    .featured-main-excerpt {
        height: 70px !important; /* 3줄 높이로 조정 */
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important; /* 3줄로 제한 */
        -webkit-box-orient: vertical !important;
        text-overflow: ellipsis !important;
        line-height: 1.6 !important;
    }
}


/* 1600px 이하에서 사이드바 광고 숨기기 (겹침 방지) */
@media (max-width: 1400px) {
    .sidebar-ad {
        display: none !important;
    }
}


/* ===================================
   광고 배너 사이드바 스타일 
=================================== */
.banner-sidebar {
    position: fixed;
    right: 10px;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 185px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 998;
    transition: top 0.6s ease-out;
    
    /* 글로우 효과가 잘리지 않도록 패딩 추가 */
    padding: 10px;
}
.banner-sidebar::-webkit-scrollbar {
    display: none;
}
.banner-item {
    display: block;
    width: 100%;
}
.banner-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    
    /* 빨간색 글로우 펄스 애니메이션 */
    animation: glowPulse 2s ease-in-out infinite;
}

/* 빨간색 글로우 펄스 애니메이션 정의 (30% 축소된 반경) */
@keyframes glowPulse {
    0%, 100% { 
        box-shadow: 0 0 3px rgba(255, 50, 50, 0.3);
    }
    50% { 
        box-shadow: 0 0 8px rgba(255, 50, 50, 0.8),
                    0 0 13px rgba(255, 50, 50, 0.4);
    }
}

.banner-item a {
    display: block;
    text-decoration: none;
}
.banner-item:hover img {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: rainbowGlowPulse 7s ease-in-out infinite, scalePulse 1.5s ease-in-out infinite;
}

@keyframes scalePulse {
    0%, 100% { transform: translateY(-2px) scale(1); }
    50% { transform: translateY(-2px) scale(1.05); }
}

/* 호버 시 무지개 색 펄스 애니메이션 */
@keyframes rainbowGlowPulse {
    0% { 
        box-shadow: 0 3px 13px rgba(0,0,0,0.1), 0 0 8px rgba(255, 0, 0, 0.5);
    }
    16% { 
        box-shadow: 0 3px 13px rgba(0,0,0,0.1), 0 0 14px rgba(255, 127, 0, 1);
    }
    33% { 
        box-shadow: 0 3px 13px rgba(0,0,0,0.1), 0 0 14px rgba(255, 255, 0, 1);
    }
    50% { 
        box-shadow: 0 3px 13px rgba(0,0,0,0.1), 0 0 14px rgba(0, 255, 0, 1);
    }
    66% { 
        box-shadow: 0 3px 13px rgba(0,0,0,0.1), 0 0 14px rgba(0, 0, 255, 1);
    }
    83% { 
        box-shadow: 0 3px 13px rgba(0,0,0,0.1), 0 0 14px rgba(127, 0, 255, 1);
    }
    100% { 
        box-shadow: 0 3px 13px rgba(0,0,0,0.1), 0 0 8px rgba(255, 0, 0, 0.5);
    }
}
/* 모바일에서는 메인 컨테이너 아래 표시 */
@media (max-width: 1024px) {
    .banner-sidebar {
        position: static !important;
        right: auto;
        top: auto;
        width: 100%;
        max-height: none;
        overflow: visible;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin: 0 0 0 0;
        padding: 20px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    }
}
@media (max-width: 768px) {
    .banner-sidebar {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 15px;
    }
}
@media (max-width: 480px) {
    .banner-sidebar {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   왼쪽/오른쪽 배너 분리 스타일 
=================================== */
.banner-sidebar-left {
    position: fixed;
    left: 10px;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 185px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 997;
    transition: top 0.6s ease-out;
    
    /* 글로우 효과가 잘리지 않도록 패딩 추가 */
    padding: 10px;
}

.banner-sidebar-left::-webkit-scrollbar {
    display: none;
}

.banner-sidebar-right {
    position: fixed;
    right: 10px;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 185px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 998;
    transition: top 0.6s ease-out;
    
    /* 글로우 효과가 잘리지 않도록 패딩 추가 */
    padding: 10px;
}

.banner-sidebar-right::-webkit-scrollbar {
    display: none;
}

/* 모바일에서는 분리된 배너들도 동일하게 처리 */
@media (max-width: 1024px) {
    .banner-sidebar-left,
    .banner-sidebar-right {
        position: static !important;
        left: auto;
        right: auto;
        top: auto;
        width: 100%;
        max-height: none;
        overflow: visible;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin: 0 0 0 0;
        padding: 20px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    }
}

@media (max-width: 768px) {
    .banner-sidebar-left,
    .banner-sidebar-right {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .banner-sidebar-left,
    .banner-sidebar-right {
        grid-template-columns: 1fr;
    }
}

/* 769px~1300px에서 배너와 따라오는 목차 완전 숨김 (태블릿/작은 노트북) */
@media screen and (min-width: 769px) and (max-width: 1580px) {
    .banner-sidebar,
    .banner-sidebar-left,
    .banner-sidebar-right,
    aside.banner-sidebar,
    aside.banner-sidebar-left,
    aside.banner-sidebar-right,
    .floating-toc {
        display: none !important;
        visibility: hidden !important;
    }
}

/* 카테고리가 없을 때 최소 높이 보장 */
.main-wrapper.no-sidebar {
    display: block !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
    padding: 30px 20px !important;
    min-height: calc(100vh - 300px) !important; /* 푸터 위치 보장 */
}

.main-wrapper.no-sidebar .main-content {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    min-height: calc(100vh - 400px) !important; /* 충분한 높이 확보 */
}

.main-wrapper.no-sidebar .posts-list-section {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 25px !important;
}

.main-wrapper.no-sidebar .sidebar {
    display: none !important;
}

@media (max-width: 768px) {
    .main-wrapper.no-sidebar {
        padding: 20px 10px !important;
        min-height: calc(100vh - 250px) !important;
    }
    
    .main-wrapper.no-sidebar .main-content {
        max-width: 100% !important;
        padding: 0 !important;
        min-height: calc(100vh - 350px) !important;
    }
    
    .main-wrapper.no-sidebar .posts-list-section {
        padding: 20px 15px !important;
    }
}

/* no-sidebar 상태에서 배너 마진 조정 */
@media (max-width: 1024px) {
    .main-wrapper.no-sidebar .banner-sidebar-left,
    .main-wrapper.no-sidebar .banner-sidebar-right {
        margin: 20px 0 0 0 !important;
    }
}






/* ===================================
  번역 스타일 
=================================== */

.translate-container {
position: relative;
display: flex;
align-items: center;
}

.translate-btn {
background: none;
border: none;
padding: 8px 12px;
cursor: pointer;
font-size: 14px;
color: #333;
display: flex;
align-items: center;
gap: 5px;
transition: all 0.3s ease;
}

.translate-btn:hover {
background-color: #f5f5f5;
border-radius: 4px;
}

.translate-icon {
font-size: 16px;
}

.translate-arrow {
font-size: 10px;
transition: transform 0.3s ease;
}

.translate-dropdown {
position: absolute;
top: 100%;
right: 0;
background: white;
border: 1px solid #ddd;
border-radius: 4px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
min-width: 120px;
z-index: 1000;
display: none;
}

.translate-dropdown.show {
display: block;
}

.translate-option {
padding: 10px 15px;
cursor: pointer;
border-bottom: 1px solid #eee;
transition: background-color 0.2s ease;
}

.translate-option:last-child {
border-bottom: none;
}

.translate-option:hover {
background-color: #f5f5f5;
}

.translate-option.active {
background-color: #007cba;
color: white;
}

/* 모바일 전용 번역 버튼 */
.translate-container-mobile {
display: none;
position: relative;
}

/* 모바일 대응 */
@media (max-width: 768px) {

.top-nav {
padding: 12px 20px;
position: relative;
}

/* 기존 번역 버튼 완전 제거 */
.category-nav .translate-container,
.category-nav .translate-dropdown {
display: none !important;
visibility: hidden !important;
pointer-events: none !important;
}

/* 모바일 전용 번역 버튼만 표시 */
.translate-container-mobile {
display: flex !important;
position: absolute;
top: 50%;
right: 60px;
transform: translateY(-50%);
z-index: 9999 !important;
}

/* 모바일 버튼 스타일 강제 적용 */
.translate-btn-mobile {
background: none !important;
border: none !important;
padding: 4px 8px !important;
cursor: pointer !important;
font-size: 14px !important;
color: #333 !important;
display: flex !important;
align-items: center !important;
gap: 4px !important;
}

/* 모바일 드롭다운 */
.translate-container-mobile .translate-dropdown {
position: absolute !important;
top: 100% !important;
right: 0 !important;
background: white !important;
border: 1px solid #ddd !important;
border-radius: 4px !important;
box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
min-width: 120px !important;
z-index: 10000 !important;
display: none !important;
}

.translate-container-mobile .translate-dropdown.show {
display: block !important;
}
}
