/* Elegant Business CSS v3 (Fixed Layout) */
:root {
    --bg-outer: #f4f4f4;
    /* Light gray background for the window */
    --bg-paper: #ffffff;
    /* White background for the document */
    --text-main: #333333;
    /* Dark charcoal for readability */
    --text-muted: #666666;
    --accent-color: #1a3c5e;
    /* Navy Blue for professional feel */
    --accent-light: #f0f4f8;
    /* Light blue for block backgrounds */
    --border-color: #eeeeee;

    /* Fonts */
    --font-serif: "Songti SC", "Noto Serif SC", STSong, "Times New Roman", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html {
    background-color: var(--bg-outer);
    -webkit-text-size-adjust: 100%;
    /* Prevent font scaling in landscape */
}

body {
    font-family: var(--font-sans);
    line-height: 1.8;
    color: var(--text-main);
    background-color: var(--bg-paper);

    /* Centered "Page" Layout */
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    /* Mobile padding (Crucial fix) */

    box-sizing: border-box;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
}

/* Desktop Enhancements: Card Style */
@media screen and (min-width: 768px) {
    body {
        margin: 40px auto;
        /* Top/Bottom margin */
        padding: 60px 70px;
        /* Luxurious internal padding */
        border-radius: 8px;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
        /* Soft drop shadow */
    }
}

/* Typography details */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    color: var(--accent-color);
    margin-top: 2em;
    margin-bottom: 0.8em;
    font-weight: 600;
}

h1.title {
    margin-top: 0.5em;
    border-bottom: none;
    text-align: center;
    font-size: 2.5em;
}

h1 {
    /* Chapter titles */
    font-size: 2.2em;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 15px;
}

h2 {
    font-size: 1.6em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

h3 {
    font-size: 1.3em;
}

p {
    margin-bottom: 1.5em;
    text-align: justify;
    text-justify: inter-ideograph;
}

/* Table of Contents */
#TOC {
    background-color: var(--accent-light);
    border: 1px solid #dce4ec;
    border-radius: 6px;
    padding: 30px;
    margin: 40px 0;
}

#TOC>ul {
    padding-left: 0;
    list-style: none;
}

#TOC>ul>li {
    margin-bottom: 12px;
}

#TOC a {
    text-decoration: none;
    color: var(--accent-color);
    font-weight: 500;
}

#TOC a:hover {
    text-decoration: underline;
}

/* Components */
blockquote {
    border-left: 4px solid var(--accent-color);
    background-color: #fafbfc;
    margin: 2em 0;
    padding: 1.2em 2em;
    font-family: var(--font-serif);
    color: #444;
    font-style: italic;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    margin: 2em auto;
}

hr {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 3em 0;
}

code {
    background-color: #f6f8fa;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: Menlo, monospace;
    font-size: 0.9em;
}