.site-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 44px; height: var(--header); padding: 0 max(32px, calc((100vw - 1180px)/2)); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; white-space: nowrap; }
.brand-fallback { font-size: 26px; font-weight: 760; letter-spacing: -1.25px; line-height: 1; }
.brand-edition { font-size: 24px; font-weight: 500; letter-spacing: -1.05px; margin-left: 5px; color: var(--accent); }
.brand-dot { color: var(--accent); font-weight: 800; }
.brand-images { display: none; position: relative; width: 150px; aspect-ratio: 5/2; }
.brand-images img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.brand-mono { visibility: hidden; }
html[data-theme="epaper"] .brand-color { visibility: hidden; }
html[data-theme="epaper"] .brand-mono { visibility: visible; }
html.has-brand-color:not([data-theme="epaper"]) .brand-images, html.has-brand-mono[data-theme="epaper"] .brand-images { display: block; }
html.has-brand-color:not([data-theme="epaper"]) .brand-fallback, html.has-brand-mono[data-theme="epaper"] .brand-fallback { display: none; }
html[data-theme="dark"] .brand-images { background: #fff; border-radius: 8px; }
.header-nav { display: flex; align-items: center; gap: 30px; margin-left: 12px; }
.header-nav a { position: relative; padding: 28px 0; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.header-nav a:hover, .header-nav a.active { color: var(--ink); }
.header-nav a.active::after { content: ''; position: absolute; bottom: 0; height: 2px; left: 0; right: 0; background: var(--accent); border-radius: 2px; }
.header-tools { display: flex; align-items: center; gap: 19px; margin-left: auto; }
.search-trigger { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 0; color: var(--muted); font-size: 13px; }
.search-trigger svg { width: 18px; height: 18px; }
.search-trigger kbd { font: 10px var(--sans); padding: 3px 5px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); }
.language-button { display: flex; align-items: center; gap: 7px; min-height: 40px; font-size: 13px; color: var(--body); }
.language-button svg { width: 17px; height: 17px; }
.language-short { display: none; }
.header-tools-menu { position: relative; }
.header-tools-menu summary { display: flex; align-items: center; gap: 7px; list-style: none; min-height: 40px; cursor: pointer; color: var(--body); font-size: 13px; }
.header-tools-menu summary::-webkit-details-marker { display: none; }
.header-tools-menu summary>svg { width: 17px; height: 17px; }
.header-tools-menu summary>svg:last-child { width: 11px; height: 11px; transform: rotate(90deg); }
.header-dropdown { position: absolute; top: 49px; right: -12px; width: 224px; max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); overflow-y: auto; padding: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.header-dropdown button { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 46px; padding: 9px 11px; text-align: left; font-size: 14px; border-radius: 7px; color: var(--body); }
.header-dropdown button:hover { color: var(--ink); background: var(--surface-hover); }
.header-dropdown svg { width: 18px; height: 18px; color: var(--muted); }
.note-count { font-size: 10px; margin-left: auto; border-radius: 12px; background: var(--accent-soft); color: var(--accent); padding: 2px 6px; }
.mobile-menu { display: none; }
.reading-track { position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; pointer-events: none; }
#reading-progress { height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.workspace { width: min(1180px, calc(100% - 64px)); margin: 0 auto; min-height: calc(100dvh - var(--header)); padding-top: 0; }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; padding: 28px 0 0; margin-bottom: 38px; flex-wrap: wrap; }
.breadcrumb svg { width: 12px; height: 12px; }
.breadcrumb a:hover { color: var(--accent); }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 72px; padding: 30px 0 36px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.page-footer nav { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.page-footer a { display: inline-flex; gap: 6px; align-items: center; }
.page-footer a:hover { color: var(--accent); }
.page-footer svg { width: 12px; height: 12px; }
.page-footer .text-button { font-weight: 500; color: var(--muted); min-height: 30px; }
.sidebar { inset: 0 auto 0 0; width: min(420px, 100vw); height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; border: 0; border-right: 1px solid var(--border); border-radius: 0; padding: 0; }
.sidebar[open] { display: flex; flex-direction: column; }
.drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 28px 26px 20px; }
.drawer-heading h2 { font-size: 23px; line-height: 1.35; letter-spacing: -.5px; margin: 7px 0 0; font-weight: 650; }
.drawer-heading .eyebrow { font-size: 9px; }
.sidebar-top { display: grid; gap: 2px; padding: 0 17px 20px; border-bottom: 1px solid var(--line); }
.side-link { display: flex; align-items: center; gap: 13px; min-height: 44px; padding: 10px 12px; text-align: left; color: var(--body); font-size: 14px; border-radius: 7px; }
.side-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-link:hover { background: var(--surface-hover); }
.side-link svg { width: 18px; height: 18px; }
.sidebar-curriculum { flex: 1; overflow-y: auto; padding: 23px 17px; scrollbar-width: thin; }
.sidebar-caption { display: flex; align-items: center; justify-content: space-between; margin: 0 11px 15px; color: var(--muted); font-size: 10px; letter-spacing: .1em; font-weight: 650; }
.sidebar-caption small { font-size: 10px; font-weight: 400; letter-spacing: 0; }
.nav-unit { margin: 0 0 4px; }
.nav-unit summary { display: flex; align-items: center; gap: 12px; padding: 11px; min-height: 47px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; }
.nav-unit summary::-webkit-details-marker { display: none; }
.unit-index { font: 11px var(--mono); color: var(--muted); }
.nav-unit summary>svg { margin-left: auto; width: 14px; height: 14px; color: var(--muted); }
.nav-unit[open] summary>svg { transform: rotate(90deg); }
.nav-lessons { padding: 1px 7px 8px 39px; }
.nav-lesson { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-left: 1px solid var(--border); font-size: 13px; color: var(--muted); line-height: 1.55; }
.nav-lesson:hover { color: var(--ink); background: var(--surface-hover); }
.nav-lesson.active { color: var(--accent); background: var(--accent-soft); border-left: 2px solid var(--accent); font-weight: 600; }
.nav-lesson.is-complete::after { content: '✓'; color: var(--accent); margin-left: auto; }
.sidebar-bottom { padding: 21px 29px; border-top: 1px solid var(--line); }
.sidebar-bottom a { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.sidebar-bottom svg { width: 14px; height: 14px; }
.focus-exit { position: fixed; top: 18px; right: 24px; z-index: 45; box-shadow: var(--shadow); }
html.focus-mode[data-focus-page="chapter"] .site-header, html.focus-mode[data-focus-page="chapter"] .reader-topbar, html.focus-mode[data-focus-page="chapter"] .reader-actions, html.focus-mode[data-focus-page="chapter"] .page-footer { display: none; }
html.focus-mode[data-focus-page="chapter"] .reader-shell { padding-top: 44px; }
html.focus-mode[data-focus-page="chapter"] { scroll-padding-top: 80px; }
