/* ========== KB Hero ========== */
.kb-hero { text-align: center; padding: 60px 20px; background: linear-gradient(135deg, #0066cc 0%, #004999 100%); color: #fff; border-radius: 12px; margin-bottom: 32px; }
.kb-hero h1 { font-size: 32px; margin-bottom: 8px; color: #fff; }
.kb-hero p { color: rgba(255,255,255,0.9); margin-bottom: 24px; }
.kb-search { display: flex; max-width: 640px; margin: 0 auto; gap: 8px; }
.kb-search input { flex: 1; padding: 14px 18px; border: none; border-radius: 8px; font-size: 16px; }
.kb-search input:focus { outline: 2px solid #fff; outline-offset: 2px; }
.kb-search button { padding: 14px 28px; border: none; border-radius: 8px; background: #fff; color: #0066cc; font-weight: 700; font-size: 15px; cursor: pointer; }
.kb-search button:hover { background: #f0f0f0; }

/* ========== KB Section ========== */
.kb-section { background: #fff; border-radius: 8px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.kb-section h2 { font-size: 18px; margin-bottom: 16px; color: #1f2937; }
.kb-section h2 a { color: inherit; }

/* ========== Category Grid ========== */
.kb-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.kb-cat-card { display: block; padding: 20px; border: 1px solid #e5e7eb; border-radius: 8px; text-decoration: none; color: inherit; transition: all 0.15s; }
.kb-cat-card:hover { border-color: #0066cc; box-shadow: 0 4px 12px rgba(0,102,204,0.1); transform: translateY(-1px); text-decoration: none; }
.kb-cat-name { font-size: 16px; font-weight: 600; color: #1f2937; margin-bottom: 6px; }
.kb-cat-desc { font-size: 13px; color: #6b7280; margin-bottom: 10px; }
.kb-cat-children { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.kb-cat-children span { background: #f3f4f6; color: #4b5563; padding: 2px 8px; border-radius: 10px; }

/* ========== Two Column ========== */
.kb-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .kb-two-col { grid-template-columns: 1fr; } }

/* ========== Article List (numbered) ========== */
.kb-article-list { list-style: none; counter-reset: item; padding: 0; }
.kb-article-list li { counter-increment: item; display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid #f3f4f6; gap: 12px; }
.kb-article-list li:last-child { border-bottom: none; }
.kb-article-list li::before { content: counter(item); flex: none; width: 24px; height: 24px; background: #f3f4f6; color: #6b7280; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.kb-article-list li:nth-child(-n+3)::before { background: #0066cc; color: #fff; }
.kb-article-list a { flex: 1; color: #1f2937; text-decoration: none; }
.kb-article-list a:hover { color: #0066cc; text-decoration: underline; }
.kb-views, .kb-date { font-size: 12px; color: #9ca3af; flex: none; }

/* ========== Breadcrumb ========== */
.breadcrumb { font-size: 13px; color: #6b7280; margin-bottom: 16px; }
.breadcrumb a { color: #0066cc; }
.breadcrumb span { margin: 0 6px; color: #d1d5db; }
.breadcrumb span:last-child { color: #1f2937; margin-right: 0; }

/* ========== Category Header ========== */
.kb-cat-header { background: #fff; border-radius: 8px; padding: 28px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.kb-cat-header h1 { font-size: 28px; margin-bottom: 6px; }
.kb-cat-header p { color: #6b7280; }

/* ========== Article Cards ========== */
.kb-article-cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 0; }
.kb-article-card { display: block; padding: 16px; border: 1px solid #e5e7eb; border-radius: 8px; text-decoration: none; color: inherit; transition: all 0.15s; }
.kb-article-card:hover { border-color: #0066cc; background: #f8fafc; text-decoration: none; }
.kb-article-title { font-size: 15px; font-weight: 600; color: #1f2937; margin-bottom: 6px; }
.kb-article-summary { font-size: 13px; color: #6b7280; margin-bottom: 8px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-article-meta { font-size: 12px; color: #9ca3af; }
.empty-state-mini { color: #9ca3af; padding: 16px 0; font-size: 14px; }


/* ========== Article Detail ========== */
.kb-article { background: #fff; border-radius: 8px; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.kb-article-header { padding-bottom: 20px; border-bottom: 1px solid #e5e7eb; margin-bottom: 24px; }
.kb-article-header h1 { font-size: 28px; line-height: 1.3; margin-bottom: 12px; }
.kb-article-summary-top { font-size: 15px; color: #4b5563; margin-bottom: 16px; line-height: 1.6; }
.kb-article-meta-bar { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 13px; color: #6b7280; }
.kb-internal-badge { display: inline-block; padding: 4px 12px; background: #fef3c7; color: #92400e; border-radius: 16px; font-size: 12px; margin-bottom: 12px; }
.btn-copy-link { background: #0066cc; color: #fff; border: none; padding: 6px 12px; border-radius: 4px; font-size: 13px; cursor: pointer; margin-left: auto; }
.btn-copy-link:hover { background: #0056b3; }

/* Article Body (TOAST UI Viewer) */
.kb-article-body { line-height: 1.8; font-size: 16px; color: #1f2937; }
.kb-article-body img { max-width: 100%; height: auto; border-radius: 6px; margin: 16px 0; }
.toastui-editor-contents { font-family: inherit !important; font-size: inherit !important; }
.toastui-editor-contents h1, .toastui-editor-contents h2, .toastui-editor-contents h3 { margin-top: 1.5em !important; }
.toastui-editor-contents p { margin: 1em 0 !important; }
.toastui-editor-contents pre { background: #f3f4f6 !important; padding: 16px !important; border-radius: 6px !important; }
.toastui-editor-contents code { background: #f3f4f6 !important; padding: 2px 6px !important; border-radius: 3px !important; }

/* Tags */
.kb-article-tags { margin-top: 24px; padding-top: 16px; border-top: 1px solid #e5e7eb; display: flex; gap: 8px; flex-wrap: wrap; }
.kb-article-tags .tag { font-size: 12px; color: #4b5563; background: #f3f4f6; padding: 4px 10px; border-radius: 12px; }

/* Helpful */
.kb-helpful { margin-top: 32px; padding: 20px; background: #f9fafb; border-radius: 8px; text-align: center; }
.kb-helpful p { margin-bottom: 12px; color: #4b5563; font-weight: 500; }
.kb-helpful-buttons { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.btn-helpful { padding: 8px 18px; border: 1px solid #d1d5db; background: #fff; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn-helpful:not([disabled]):hover { border-color: #0066cc; color: #0066cc; }
.btn-helpful[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ========== Search ========== */
.kb-search-header { background: #fff; border-radius: 8px; padding: 28px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.kb-search-header h1 { font-size: 22px; margin-bottom: 16px; }
.kb-search-inline { max-width: 100%; }
.kb-search-inline input { background: #f9fafb; border: 1px solid #e5e7eb; }
.kb-search-meta { color: #6b7280; font-size: 14px; margin-top: 12px; }
.kb-search-results { list-style: none; padding: 0; }
.kb-search-results li { border-bottom: 1px solid #e5e7eb; }
.kb-search-results li:last-child { border-bottom: none; }
.kb-search-result { display: block; padding: 16px 0; text-decoration: none; color: inherit; }
.kb-search-result:hover { text-decoration: none; background: #f9fafb; padding-left: 12px; padding-right: 12px; margin: 0 -12px; border-radius: 6px; }
.kb-search-cat { font-size: 12px; color: #0066cc; margin-bottom: 4px; }
.kb-search-title { font-size: 17px; font-weight: 600; color: #1f2937; margin-bottom: 6px; }
.kb-search-summary { font-size: 14px; color: #4b5563; margin-bottom: 6px; line-height: 1.5; }
.kb-search-meta-row { font-size: 12px; color: #9ca3af; }


/* KB 본문 이미지 반응형 */
.kb-article-body img {
    max-width: 100%;
    height: auto;
}

/* 모바일 검색폼 */
@media (max-width: 600px) {
    .kb-search {
        max-width: 100%;
        flex-wrap: nowrap;
    }
    .kb-search input {
        min-width: 0;
        padding: 12px 14px;
        font-size: 15px;
    }
    .kb-search button {
        flex-shrink: 0;
        padding: 12px 18px;
        white-space: nowrap;
    }
}

/* 카테고리 섹션 헤더 (제목 + 전체 보기 링크) */
.kb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}
.kb-section-header h2 {
    margin: 0;
}
.kb-section-more {
    font-size: 14px;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 16px;
}
.kb-section-more:hover {
    text-decoration: underline;
}
/* 지식문서 하단 피드백 숫자 감추기 */
.kb-fb-count { display: none; }

/* 메타 영역(플랫폼)의 클릭 가능 링크 */
.kb-meta-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
    opacity: 0.85;
}
.kb-meta-link:hover {
    opacity: 1;
    color: #2563eb;
}

/* 태그 링크 (기존 .tag 위에 hover 효과만 추가) */
.tag-link {
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.tag-link:hover {
    background: #2563eb;
    color: #ffffff;
}
