:root {
    --bg-color: #F9FAFB; --content-bg: #FFFFFF; --sidebar-bg: #FFFFFF; --text-color: #374151; --heading-color: #111827;
    --primary-color: #2B3A4F; --accent-color: #B99767; --border-color: #E5E7EB;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-serif: Georgia, "Times New Roman", "KaiTi", "STSong", serif;
}
body { font-family: var(--font-sans); color: var(--text-color); background-color: var(--bg-color); margin: 0; font-size: 17px; line-height: 1.7; }
* { box-sizing: border-box; }
a { color: var(--accent-color); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6, .top-nav a, .nav-tree summary, th { font-family: var(--font-sans); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* --- HEADER / FOOTER --- */
.top-header { width: 100%; background-color: var(--content-bg); border-bottom: 1px solid var(--border-color); padding: 0 48px; position: sticky; top: 0; z-index: 100; }
.top-nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.top-nav .logo a { font-weight: 700; font-size: 1.25em; color: var(--heading-color); text-decoration: none; }
.top-nav .nav-links a { font-size: 1em; font-weight: 600; color: var(--text-color); text-decoration: none; padding: 20px 16px; transition: color 0.2s; }
.top-nav .nav-links a.active, .top-nav .nav-links a:hover { color: var(--primary-color); }
.footer { padding: 48px 0; text-align: center; font-size: 0.9em; color: #888; }

/* --- HOMEPAGE SPECIFIC STYLES --- */
.homepage-main { background-color: #fff; }
.hero { text-align: center; padding: 120px 24px; background-color: var(--bg-color); }
.hero h1 { font-size: 3.5em; margin: 0 0 16px 0; line-height: 1.2; }
.hero .subtitle { font-size: 1.25em; max-width: 800px; margin: 0 auto 32px auto; color: #555; line-height: 1.8; }
.hero .cta-button { display: inline-block; background-color: var(--accent-color); color: #fff; padding: 16px 48px; font-size: 1.1em; font-weight: 600; text-decoration: none; border-radius: 8px; transition: background-color 0.2s; }
.hero .cta-button:hover { background-color: #a38252; text-decoration: none; }
.pillars { padding: 80px 0; background-color: var(--content-bg); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.pillars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.pillar-card { text-align: center; }
.pillar-card .icon { font-size: 3em; color: var(--accent-color); margin-bottom: 16px; }
.pillar-card h3 { font-size: 1.5em; margin: 0 0 8px 0; }
.pillar-card p { font-size: 1em; line-height: 1.7; color: #555; }
.architecture { padding: 80px 0; }
.section-title { text-align: center; font-size: 2.5em; margin-bottom: 16px; }
.section-subtitle { text-align: center; font-size: 1.2em; max-width: 700px; margin: 0 auto 64px auto; color: #555; }
.architecture-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
a.architecture-card-link { text-decoration: none; color: inherit; }
.architecture-card { display: flex; align-items: center; background-color: var(--content-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 32px; transition: transform 0.2s, box-shadow 0.2s; }
.architecture-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.05); }
.architecture-card .part-number { font-size: 2em; font-weight: 700; color: var(--accent-color); margin-right: 24px; }
.architecture-card .content h4 { font-size: 1.4em; margin: 0 0 8px 0; }
.architecture-card .content p { margin: 0; color: #555; }
.quantified { padding: 80px 0; background-color: var(--primary-color); color: #fff; }
.quantified .section-title, .quantified .section-subtitle { color: #fff; }
.quantified .section-subtitle { opacity: 0.8; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-top: 64px; }
.kpi-card { background-color: rgba(255,255,255,0.05); text-align: center; padding: 24px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); }
.kpi-card .value { font-size: 2.5em; font-weight: 700; margin-bottom: 8px; }
.kpi-card .label { font-size: 1em; opacity: 0.8; }

/* --- CONTENT PAGE LAYOUT --- */
.main-layout { display: flex; flex-grow: 1; }
.sidebar { width: 280px; background-color: var(--sidebar-bg); padding: 32px; border-right: 1px solid var(--border-color); overflow-y: auto; flex-shrink: 0; position: sticky; top: 65px; height: calc(100vh - 65px); }
.content-area { flex-grow: 1; padding: 0 48px; }
.content-wrapper { max-width: 800px; margin: 48px auto; background-color: var(--content-bg); border-radius: 8px; border: 1px solid var(--border-color); box-shadow: 0 10px 25px rgba(0,0,0,0.03); overflow: hidden; }

/* --- SIDEBAR NAVIGATION --- */
.nav-tree h4 { font-size: 1.1em; margin: 0 0 24px 0; font-weight: 700; }
.nav-tree ul { list-style-type: none; padding-left: 1rem; }
.nav-tree summary a { text-decoration: none; color: inherit; display: block; }
.nav-tree summary.active a, .nav-tree summary a:hover { color: var(--accent-color); }
.nav-tree summary.active { font-weight: 700; }
.nav-tree details[open] > summary { color: var(--primary-color); }
.nav-tree summary { cursor: pointer; font-weight: 600; padding: 8px 0; list-style: none; user-select: none; position: relative; }
.nav-tree summary::-webkit-details-marker { display: none; }
.nav-tree summary::before { content: '▸'; margin-right: 8px; font-family: sans-serif; transition: transform 0.2s; position: absolute; left: -1rem; top: 10px;}
.nav-tree details[open] > summary::before { transform: rotate(90deg); }
.nav-tree li a { display: block; padding: 8px 0 8px 16px; font-family: var(--font-sans); font-weight: 400; font-size: 0.95em; color: var(--text-color); text-decoration: none; border-left: 2px solid transparent; }
.nav-tree li a.active, .nav-tree li a:hover { color: var(--accent-color); font-weight: 600; }
.nav-tree li a.active { border-left: 2px solid var(--accent-color); }

/* --- CONTENT PAGE STYLES --- */
.page-header { background-color: var(--primary-color); background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px); background-size: 20px 20px; color: #FFFFFF; padding: 48px; }
.page-header h1 { color: #FFFFFF; font-size: 2.8em; margin: 0; }
.page-header .page-subtitle { font-family: var(--font-sans); font-size: 1.2em; color: #FFFFFF; opacity: 0.8; margin: 16px 0 0 0; }
article { padding: 48px; font-family: var(--font-serif); }
article h2 { font-size: 1.8em; margin: 48px 0 24px 0; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); color: var(--primary-color); }
article h2:first-of-type { margin-top: 0; }
article h3 { font-size: 1.3em; margin: 32px 0 16px 0; font-family: var(--font-sans); color: var(--heading-color); }
article p, article li { font-size: 1.05em; margin-bottom: 1em; }
article ul { padding-left: 24px; }
article strong { font-family: var(--font-sans); color: var(--heading-color); font-weight: 600; }
article ul li::marker { color: var(--accent-color); }
article a { font-weight: bold; border-bottom: 1px solid var(--border-color); }
article a:hover { border-bottom-color: var(--accent-color); }

/* --- TABLES --- */
.comparison-table-container { margin: 48px 0; }
.comparison-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border-color); }
.comparison-table th, .comparison-table td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--border-color); vertical-align: top; }
.comparison-table thead th { background-color: var(--bg-color); font-size: 1.1em; color: var(--heading-color); font-weight: 700; border-bottom: 2px solid var(--accent-color); }
.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table tbody td { font-family: var(--font-serif); font-size: 1em; }
.comparison-table th:first-child, .comparison-table td:first-child { width: 30%; }
.comparison-table td:first-child { font-family: var(--font-sans); font-weight: 600; color: var(--primary-color); background-color: var(--bg-color); }

/* --- TOOLTIPS --- */
.tooltip { position: relative; border-bottom: 1px dotted var(--text-color); cursor: help; }
.tooltip .tooltip-text {
    visibility: hidden; width: 280px; background-color: var(--primary-color); color: #fff; text-align: left;
    border-radius: 6px; padding: 12px; position: absolute; z-index: 10; bottom: 140%; left: 50%; margin-left: -140px;
    opacity: 0; transition: opacity 0.3s; font-family: var(--font-sans); font-size: 0.9em; font-weight: 400;
    line-height: 1.6; box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.tooltip .tooltip-text::after {
    content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px;
    border-width: 5px; border-style: solid; border-color: var(--primary-color) transparent transparent transparent;
}
.tooltip:hover .tooltip-text { visibility: visible; opacity: 1; }

/* --- LANDING PAGES --- */
.chapter-nav-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 48px; }
.chapter-nav-card { display: flex; align-items: flex-start; background-color: var(--bg-color); border: 1px solid var(--border-color); border-radius: 8px; padding: 32px; transition: transform 0.2s, box-shadow 0.2s; text-decoration: none; color: inherit; }
.chapter-nav-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.05); border-color: var(--accent-color); }
.chapter-nav-card .part-number { font-size: 1.5em; font-weight: 700; color: var(--accent-color); margin-right: 24px; line-height: 1.4; }
.chapter-nav-card .content h4 { font-size: 1.4em; margin: 0 0 8px 0; color: var(--heading-color); }
.chapter-nav-card .content p { margin: 0; color: #555; font-family: var(--font-serif); font-size: 1em; }