/* GitBook Technical E-Book Theme - Adjusted Deep Cobalt Palette */
:root {
    --book-accent: #1d4ed8;
    --book-link: #2563eb;
    --sidebar-bg: #f8fafc;
    --body-bg: #ffffff;
    --border: #e2e8f0;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-mono: Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    background: var(--body-bg);
    color: var(--text-dark);
    font-family: var(--font-sans);
    font-size: 15.5px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--book-link);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--book-accent);
    text-decoration: underline;
}

/* GitBook Outer Layout */
.book {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
}

/* Left Sidebar (300px) */
.book-summary {
    width: 300px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.summary-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-header img {
    width: 26px;
    height: 26px;
    border-radius: 6px;
}

.summary-header span {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-dark);
}

.search-wrapper {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    background: #ffffff;
    color: var(--text-dark);
    outline: none;
}

.summary-nav {
    padding: 12px 0;
    flex: 1;
}

.chapter-header {
    padding: 10px 18px 4px 18px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.summary-list {
    list-style: none;
    margin-bottom: 12px;
}

.summary-list li a {
    display: block;
    padding: 7px 18px;
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.4;
    text-decoration: none !important;
}

.summary-list li a:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--book-accent);
}

.summary-list li.active a {
    background: #eff6ff;
    color: var(--book-accent);
    font-weight: 700;
    border-left: 3px solid var(--book-accent);
}

/* Center Body */
.book-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.book-header {
    height: 52px;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-sidebar-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.toggle-sidebar-btn:hover {
    background: var(--sidebar-bg);
}

.header-doc-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-header {
    background: var(--book-accent);
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none !important;
}

/* Main Content Wrapper (800px reading width) */
.page-wrapper {
    flex: 1;
    padding: 36px 24px 64px 24px;
}

.page-inner {
    max-width: 820px;
    margin: 0 auto;
}

.markdown-section h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.25;
}

.markdown-section h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
    margin: 36px 0 14px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.markdown-section h3 {
    font-size: 19px;
    font-weight: 700;
    margin: 22px 0 8px 0;
}

.markdown-section p {
    font-size: 15.5px;
    line-height: 1.8;
    margin-bottom: 16px;
}

/* Feature Trio & Highlights */
.feature-box {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-list li {
    font-size: 15px;
    line-height: 1.65;
}

.feature-list li strong {
    color: var(--book-accent);
}

/* Action Callout Box */
.action-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 32px 0;
}

.btn-cta {
    background: var(--book-accent);
    color: #ffffff !important;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: 4px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Code Blocks */
.code-block {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 18px;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.65;
    overflow-x: auto;
    margin: 18px 0;
    color: #334155;
}

/* Download Page */
.download-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 44px;
    background: #ffffff;
    max-width: 820px;
    margin: 40px auto;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.download-card h1 {
    font-size: 30px;
    font-weight: 800;
    color: var(--book-accent);
    margin-bottom: 12px;
}

.spec-table {
    width: 100%;
    margin: 24px 0;
    border-collapse: collapse;
    text-align: left;
}

.spec-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.spec-table td:first-child {
    font-weight: 700;
    color: var(--text-muted);
    width: 130px;
}

/* Footer */
.book-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    background: var(--sidebar-bg);
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .book-summary {
        display: none;
    }
    .action-box {
        flex-direction: column;
        align-items: flex-start;
    }
}
@media (max-width: 880px) {
    .nav-links, .nav-menu {
        display: none !important;
    }
}
