/* ===========================================
   Guide Module - GitBook-style Layout
   Brand: #d63031 (red), #c0392b (dark red)
   =========================================== */

/* Hero section on index page */
.guide-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 40px 30px;
    border-radius: 6px;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 3px solid #d63031;
}
.guide-hero h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}
.guide-hero p {
    margin: 0;
    font-size: 16px;
    opacity: 0.85;
}

/* Category cards grid */
.guide-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.guide-category-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
}
.guide-category-card:hover {
    box-shadow: 0 4px 16px rgba(214, 48, 49, 0.15);
    transform: translateY(-2px);
    border-color: #d63031;
}
.guide-category-card > a {
    display: block;
    padding: 24px;
    color: inherit;
    text-decoration: none;
}
.guide-category-icon {
    width: 48px;
    height: 48px;
    background: rgba(214, 48, 49, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 22px;
    color: #d63031;
}
.guide-category-card h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #222;
    border-bottom: none;
}
.guide-category-card p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}
.guide-article-count {
    font-size: 13px;
    color: #999;
}
.guide-subcategories {
    list-style: none;
    margin: 0;
    padding: 8px 24px 16px;
    border-top: 1px solid #f0f0f0;
}
.guide-subcategories li {
    padding: 4px 0;
}
.guide-subcategories li a {
    color: #d63031;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.guide-subcategories li a:hover {
    color: #c0392b;
}
.guide-subcategories .badge {
    background: rgba(214, 48, 49, 0.1);
    color: #d63031;
    font-size: 11px;
}

/* Two-column layout: sidebar + content */
.guide-layout {
    display: flex;
    min-height: 500px;
    gap: 0;
    margin: -15px -15px 0;
}

/* Sidebar */
.guide-sidebar {
    width: 260px;
    min-width: 260px;
    background: #f7f8fa;
    border-right: 1px solid #e8e8e8;
    padding: 0;
    overflow-y: auto;
}
.guide-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
    font-weight: 600;
}
.guide-sidebar-header a {
    color: #222;
    text-decoration: none;
    font-size: 15px;
}
.guide-sidebar-header a:hover {
    color: #d63031;
}
.guide-nav {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.guide-nav-group {
    margin-bottom: 2px;
}
.guide-nav-category {
    display: block;
    padding: 8px 20px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s;
}
.guide-nav-category:hover {
    background: rgba(214, 48, 49, 0.05);
    color: #d63031;
    text-decoration: none;
}
.guide-nav-group.active > .guide-nav-category {
    color: #d63031;
    background: rgba(214, 48, 49, 0.08);
}
.guide-nav-sub,
.guide-nav-articles {
    list-style: none;
    margin: 0;
    padding: 0;
}
.guide-nav-sub li a,
.guide-nav-articles li a {
    display: block;
    padding: 5px 20px 5px 36px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    border-left: 2px solid transparent;
    transition: all 0.15s;
}
.guide-nav-sub li a:hover,
.guide-nav-articles li a:hover {
    color: #d63031;
    background: rgba(214, 48, 49, 0.04);
    text-decoration: none;
}
.guide-nav-sub li.active a,
.guide-nav-articles li.active a {
    color: #d63031;
    border-left-color: #d63031;
    background: rgba(214, 48, 49, 0.08);
    font-weight: 500;
}

/* Main content area */
.guide-content {
    flex: 1;
    padding: 20px 30px;
    min-width: 0;
}

/* Breadcrumb */
.guide-breadcrumb {
    font-size: 13px;
    color: #999;
    margin-bottom: 16px;
}
.guide-breadcrumb a {
    color: #d63031;
    text-decoration: none;
}
.guide-breadcrumb a:hover {
    text-decoration: underline;
}
.guide-breadcrumb .separator {
    margin: 0 6px;
    color: #ccc;
}

/* Category description */
.guide-category-desc {
    color: #666;
    font-size: 15px;
    margin-bottom: 24px;
}

/* Article list in category view */
.guide-article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.guide-article-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.guide-article-item:hover {
    border-color: #d63031;
    box-shadow: 0 2px 8px rgba(214, 48, 49, 0.12);
    text-decoration: none;
    color: inherit;
}
.guide-article-thumb {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
}
.guide-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.guide-article-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #ccc;
}
.guide-article-info h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #222;
    border-bottom: none;
}
.guide-article-info p {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: #777;
    line-height: 1.4;
}

/* Article view */
.guide-article h1 {
    font-size: 26px;
    font-weight: 700;
    color: #222;
    margin: 0 0 12px 0;
    line-height: 1.3;
}
.guide-article-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #999;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}
.guide-article-meta .fas,
.guide-article-meta .far {
    margin-right: 4px;
}

/* Table of Contents */
.guide-toc {
    background: #fef9f9;
    border: 1px solid #f0d0d0;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.guide-toc-title {
    font-weight: 600;
    font-size: 14px;
    color: #d63031;
    margin-bottom: 10px;
}
.guide-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.guide-toc li {
    padding: 3px 0;
}
.guide-toc li a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
}
.guide-toc li a:hover {
    color: #d63031;
    text-decoration: underline;
}
.guide-toc li.guide-toc-sub {
    padding-left: 16px;
}
.guide-toc li.guide-toc-sub a {
    color: #777;
    font-size: 13px;
}

/* Article body content */
.guide-article-body {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
}
.guide-article-body h2 {
    font-size: 22px;
    font-weight: 600;
    color: #222;
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}
.guide-article-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 24px 0 10px;
}
.guide-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 12px 0;
}
.guide-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}
.guide-article-body table th,
.guide-article-body table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}
.guide-article-body table th {
    background: #f5f5f5;
    font-weight: 600;
}
.guide-article-body code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 90%;
}
.guide-article-body blockquote {
    border-left: 4px solid #d63031;
    background: #fef9f9;
    padding: 12px 16px;
    margin: 16px 0;
    color: #555;
}
.guide-article-body ul, .guide-article-body ol {
    padding-left: 24px;
}
.guide-article-body li {
    margin-bottom: 4px;
}

/* Prev/Next navigation */
.guide-nav-prevnext {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    gap: 16px;
}
.guide-nav-prev,
.guide-nav-next {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
    max-width: 48%;
}
.guide-nav-prev:hover,
.guide-nav-next:hover {
    border-color: #d63031;
    text-decoration: none;
    color: inherit;
}
.guide-nav-prev small,
.guide-nav-next small {
    color: #999;
    font-size: 12px;
}
.guide-nav-prev span,
.guide-nav-next span {
    color: #d63031;
    font-weight: 500;
    font-size: 14px;
    margin-top: 2px;
}
.guide-nav-next {
    text-align: right;
    margin-left: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .guide-layout {
        flex-direction: column;
        margin: -15px -15px 0;
    }
    .guide-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #e8e8e8;
        max-height: 300px;
    }
    .guide-content {
        padding: 16px;
    }
    .guide-categories-grid {
        grid-template-columns: 1fr;
    }
    .guide-nav-prevnext {
        flex-direction: column;
    }
    .guide-nav-prev,
    .guide-nav-next {
        max-width: 100%;
    }
}
