/* --- E-book Futuristic Style CSS --- */

:root {
    --font-primary-heading: "Exo 2", sans-serif;
    --font-secondary-body: "Roboto", sans-serif;
    --font-monospace-accent: "Share Tech Mono", monospace;

    --color-bg-deep: #0a0f1f; /* Deep, dark blue/almost black */
    --color-bg-medium: #10182f; /* Slightly lighter dark for accents like TOC */
    --color-bg-light-accent: #1a2849; /* For subtle borders or backgrounds */

    --color-text-primary: #c0c8e0; /* Light cool gray/blue for body text */
    --color-text-secondary: #808aaf; /* Muted text for captions, less emphasis */
    --color-text-heading: #e0e8ff; /* Brighter white/cool blue for headings */

    --color-accent-primary: #00e5ff; /* Bright electric cyan */
    --color-accent-secondary: #4d7eff; /* A slightly deeper blue accent */
    --color-accent-glow: rgba(0, 229, 255, 0.3); /* For glow effects */

    --base-font-size-screen: 16px;
    --content-max-width-screen: 70ch;
    --toc-width-large-screen: 300px; /* Slightly wider for futuristic TOC */
    --gap-large-screen: 2.5rem; /* More spacing */
}

/* --- Page Setup (PAGED MEDIA RULES - For Print) --- */
@page {
    size: 5.5in 8.5in; margin-top: .7in; margin-bottom: .58in; margin-left: .75in; margin-right: .75in;
    padding: 0; counter-increment: page_num;
    @bottom-center {
        font-family: "Jost", sans-serif; /* Print still uses inspo font */
        font-weight: 300; content: counter(page_num); font-size: 9pt;
       	color: #333; /* Print page num color */
       	position: relative; margin-top: -.35in;
    }
}

html {
    font-size: var(--base-font-size-screen);
    scroll-behavior: smooth;
    background-color: var(--color-bg-deep);
}
body {
    font-family: var(--font-secondary-body);
    color: var(--color-text-primary);
    line-height: 1.7; /* Good for screen readability */
    font-size: 1rem;
    background-color: var(--color-bg-deep);
    margin: 0; padding: 0;
    counter-reset: page_num chap_num; /* For print logic in @page */
}

.page-wrapper { display: flex; flex-direction: column; }
.ebook-container { flex-grow: 1; max-width: var(--content-max-width-screen); margin: 0 auto; padding: 2.5rem 1.5rem; }

.toc-sidebar {
    background-color: var(--color-bg-medium);
    padding: 2rem 1.5rem;
    width: 100%; order: -1;
    border-bottom: 1px solid var(--color-accent-primary); /* Accent border */
    box-shadow: 0 5px 15px rgba(0, 229, 255, 0.05);
    display: none;
}
.toc-sidebar:target, .toc-sidebar.is-active { display: block; }

.toc-page-mobile { text-align: center; padding: 1.5rem 0; margin-bottom: 1rem; }
.toc-mobile-toggle {
    font-family: var(--font-primary-heading);
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--color-accent-primary);
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--color-accent-primary);
    border-radius: 2px; /* Sharper edges */
    display: inline-block;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.toc-mobile-toggle:hover {
    background-color: var(--color-accent-primary);
    color: var(--color-bg-deep);
    box-shadow: 0 0 15px var(--color-accent-glow);
}

.page { margin-bottom: 3rem; }
.page:last-child { margin-bottom: 0; }

.cover-page {
    text-align: center; min-height: 80vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    font-family: var(--font-primary-heading);
}
.cover-page .ebook-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 500;
    color: var(--color-text-heading);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    text-shadow: 0 0 10px var(--color-accent-glow);
}
.cover-page .ebook-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.8rem);
    font-weight: 300;
    font-style: normal; /* Not italic for this theme */
    color: var(--color-text-secondary);
    margin-bottom: 2.5rem;
    max-width: 90%;
    letter-spacing: 0.5px;
}
.cover-page .ebook-author {
    font-family: var(--font-monospace-accent);
    font-size: clamp(0.9rem, 2.5vw, 1.3rem);
    font-weight: 400;
    color: var(--color-accent-secondary);
}

.toc-header { text-align: center; margin-bottom: clamp(1.5rem, 5vh, 2rem); }
.toc-title {
    display: inline-block;
    font-family: var(--font-primary-heading);
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    font-weight: 400;
    color: var(--color-text-heading);
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid var(--color-accent-primary);
    line-height: 1.3; margin: 0;
    letter-spacing: 0.5px;
}
.toc-nav ul { list-style: none; padding-left: 0; font-size: 1rem; }
.toc-nav ul ul { padding-left: 1.5rem; margin-top: 0.35rem; }
.toc-nav li { margin-bottom: 0.6rem; }
.toc-nav a {
    text-decoration: none;
    color: var(--color-text-primary);
    display: flex; justify-content: space-between;
    padding: 0.35rem 0.2rem;
    border-left: 2px solid transparent; /* For hover effect */
    transition: color 0.2s ease, border-left-color 0.2s ease, padding-left 0.2s ease;
    font-family: var(--font-monospace-accent);
    font-size: 0.9rem;
}
.toc-nav a:hover, .toc-nav a:focus {
    color: var(--color-accent-primary);
    border-left-color: var(--color-accent-primary);
    padding-left: 0.7rem;
}
.toc-nav a .toc-page-num {
    font-weight: 300;
    color: var(--color-text-secondary);
    margin-left: 1rem;
    display: none; /* Print page nums hidden in screen TOC sidebar */
    font-family: var(--font-secondary-body); /* Less techy for the number */
}

.chapter { text-align: left; }
.chapter-title-container {
    text-align: center;
    margin-top: clamp(3rem, 10vh, 4.5rem);
    margin-bottom: clamp(2rem, 7vh, 3rem);
}
.chapter-main-title { /* h2 Chapter Title */
    font-family: var(--font-primary-heading);
    font-weight: 400; /* Less bold than cover title */
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    color: var(--color-text-heading);
    letter-spacing: 0.5px;
    line-height: 1.3;
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--color-bg-light-accent);
    border-image: linear-gradient(to right, var(--color-accent-secondary), var(--color-accent-primary)) 1;
    margin: 0;
    position: relative; /* For pseudo-elements */
}
.chapter-main-title::before, .chapter-main-title::after {
    content: '';
    position: absolute;
    width: 10px; height: 1px;
    background: var(--color-accent-primary);
    top: 50%;
    transform: translateY(-50%);
}
.chapter-main-title::before { left: -20px; }
.chapter-main-title::after { right: -20px; }


p {
    font-size: 1rem;
    line-height: 1.75; /* Slightly more spacing for dark BG */
    text-align: left; /* Justified can be harder on dark bg for some */
    margin: 0 0 1.1rem 0;
    color: var(--color-text-primary);
}
.chapter-content > p:first-of-type,
.chapter-title-container + .chapter-content > p:first-of-type,
.chapter-content > h3 + p, .chapter-content > h4 + p,
.chapter-content > blockquote + p, .chapter-content > figure + p,
.chapter-content > .responsive-video-container + p,
.chapter-content > pre + p, .chapter-content > hr + p,
.chapter-content > ul + p, .chapter-content > ol + p {
    text-indent: 0;
}

h3, h4, h5, h6 { /* Standard subheadings */
    font-family: var(--font-primary-heading);
    font-weight: 400;
    color: var(--color-accent-secondary);
    font-size: clamp(1.3rem, 3.8vw, 1.9rem);
    margin-top: 2.5rem; margin-bottom: 1.2rem;
    text-align: left; line-height: 1.4;
    letter-spacing: 0.3px;
    border-left: 3px solid var(--color-accent-primary);
    padding-left: 0.75rem;
}
h4 { font-size: clamp(1.1rem, 3.2vw, 1.6rem); color: var(--color-accent-primary); border-left-color: var(--color-accent-secondary); }

blockquote {
    font-size: 0.95rem; font-style: normal;
    font-family: var(--font-monospace-accent);
    margin: 2rem 1rem 2rem 2.5rem;
    padding: 1rem 1.2rem 1rem 1.8rem; /* top right bottom left */
    border-left: 2px solid var(--color-accent-primary);
    background-color: rgba(0, 229, 255, 0.03); /* Very faint accent bg */
    color: var(--color-text-secondary);
    position: relative;
}
blockquote::before { /* Quotation mark styling */
    content: '>'; /* Or "“" */
    font-family: var(--font-primary-heading);
    font-size: 2.5rem;
    color: var(--color-accent-primary);
    opacity: 0.5;
    position: absolute;
    left: -0.2em;
    top: -0.1em;
}
blockquote p { text-indent: 0 !important; font-size: inherit; line-height: 1.6; margin-bottom: 0.5rem; color: inherit; }
blockquote footer { font-style: normal; font-size: 0.9em; text-align: right; margin-top: 0.8rem; color: var(--color-accent-secondary); }
blockquote footer::before { content: "// "; }

.responsive-image { margin: 2.5rem auto; text-align: center; }
.responsive-image img {
    max-width: 100%; height: auto; display: block;
    margin: 0 auto 0.5rem auto;
    border: 1px solid var(--color-bg-light-accent);
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.1);
}
.responsive-image figcaption {
    font-family: var(--font-monospace-accent);
    font-size: 0.9rem;
    font-style: normal; color: var(--color-text-secondary);
    text-align: center; margin-top: 0.5rem;
}

.responsive-video-container {
    position: relative; padding-bottom: 56.25%; height: 0;
    overflow: hidden; max-width: 100%;
    margin: 2rem 0; border-radius: 2px;
    border: 1px solid var(--color-bg-light-accent);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.08);
}
.responsive-video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

ul, ol { margin: 0.5rem 0 1.2rem 1.5rem; padding-left: 1rem; font-size: 1rem; }
li { margin-bottom: 0.4rem; padding-left: 0.5rem; position: relative; }
/* Custom list bullets */
ul li::before {
    content: '»'; /* Or '●', '>', '-' */
    position: absolute;
    left: -0.8em;
    color: var(--color-accent-primary);
    font-weight: bold;
}
ol { counter-reset: list-counter; }
ol li { list-style: none; }
ol li::before {
    content: counter(list-counter) ".";
    counter-increment: list-counter;
    position: absolute;
    left: -1.5em; /* Adjust as needed for number width */
    width: 1.2em; /* Ensure space for two digits */
    text-align: right;
    color: var(--color-accent-primary);
    font-weight: bold;
    font-family: var(--font-monospace-accent);
}


hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, transparent, var(--color-accent-primary), transparent);
    margin: 3rem auto;
    width: 70%;
}

a { color: var(--color-accent-primary); text-decoration: none; transition: color 0.2s ease, text-shadow 0.2s ease; }
a:hover, a:focus { color: var(--color-text-heading); text-shadow: 0 0 8px var(--color-accent-glow); }

/* Code blocks */
pre {
    font-family: var(--font-monospace-accent);
    background-color: rgba(0,0,0,0.2); /* Darker transparent overlay */
    border: 1px solid var(--color-bg-light-accent);
    border-left: 3px solid var(--color-accent-primary);
    border-radius: 2px;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9em;
    color: var(--color-text-primary);
    line-height: 1.5;
}
code { /* Inline code */
    font-family: var(--font-monospace-accent);
    background-color: rgba(var(--color-accent-primary-rgb, 0, 229, 255), 0.1);
    color: var(--color-accent-primary);
    padding: 0.15em 0.4em;
    border-radius: 2px;
    font-size: 0.9em;
}
pre code { background-color: transparent; color: inherit; padding: 0; font-size: inherit; }


@media (min-width: 1024px) {
    .page-wrapper { flex-direction: row; margin: 0 auto; }
    .toc-sidebar {
        display: block !important; flex: 0 0 var(--toc-width-large-screen);
        height: 100vh; position: sticky; top: 0; overflow-y: auto;
        order: 0; border-bottom: none; border-right: 1px solid var(--color-accent-primary);
        box-shadow: 5px 0 15px rgba(0, 229, 255, 0交响乐式的代码结构中（继续完整的CSS）

```css
        box-shadow: 5px 0 15px rgba(0, 229, 255, 0.05);
    }
    .toc-page-mobile { display: none; }
    .ebook-container { margin-left: var(--gap-large-screen); margin-right: auto; padding-left: 0; max-width: var(--content-max-width-screen); }
    .toc-nav a .toc-page-num { display: inline; }
}

@media (min-width: 1920px) { /* For very wide screens */
    html { font-size: calc(var(--base-font-size-screen) * 1.05); } /* Subtle boost */
    :root {
        --toc-width-large-screen: 320px;
        --content-max-width-screen: 75ch;
    }
}

@media print {
    html { font-size: 12pt; background-color: #fff; }
    body {
        font-family: "Lora", serif; /* Revert to print-specific serif */
        color: #000; line-height: 14.3pt; font-size: 12pt;
        background-color: #fff; padding: 0; margin: 0;
        counter-reset: page_num chap_num;
    }
    .page-wrapper, .ebook-container { display: block; max-width: none; margin: 0; padding: 0; }
    .toc-sidebar {
        display: block; position: static; width: auto; height: auto; padding: 0;
        border: none; box-shadow: none; page-break