/* 华夏文明在科技时代的复兴 · 书与书页 */
:root {
	--desk: #e7dfd1;
	--desk-2: #d9cfbe;
	--paper: #f5eddc;
	--paper-2: #efe5d0;
	--ink: #241e17;
	--ink-2: #5b5145;
	--ink-3: #8a7f70;
	--zhu: #b3341f;
	--zhu-2: #d0573f;
	--dian: #1f3657;
	--dian-2: #2f4e78;
	--indigo: #1f3657;
	--huang: rgba(233, 182, 64, .42);
	--rule: rgba(179, 52, 31, .55);
	--rule-2: rgba(179, 52, 31, .13);
	--shade: rgba(40, 26, 12, .28);
	--serif: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', serif;
	--kai: 'LXGW WenKai', 'Kaiti SC', 'STKaiti', 'KaiTi', var(--serif);
	--brush: 'Ma Shan Zheng', var(--kai);
	--ui: 'Space Grotesk', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
	--mono: 'JetBrains Mono', ui-monospace, monospace;
	--paper-img: none;
}
.app[data-theme="night"] {
	--desk: #131517;
	--desk-2: #0c0d0f;
	--paper: #24211c;
	--paper-2: #1e1b17;
	--ink: #e5dac6;
	--ink-2: #b5a991;
	--ink-3: #857a68;
	--zhu: #e46a4e;
	--zhu-2: #f08a6e;
	--dian: #9fbbe0;
	--dian-2: #b9cfee;
	--indigo: #22395c;
	--huang: rgba(214, 168, 62, .32);
	--rule: rgba(228, 106, 78, .5);
	--rule-2: rgba(228, 106, 78, .12);
	--shade: rgba(0, 0, 0, .5);
}

/* ---------- 书 ---------- */
.stage {
	position: fixed;
	inset: 0;
	overflow: hidden;
}
.bookwrap {
	position: absolute;
	left: 50%;
	top: 50%;
	width: calc(var(--bw, 1200) * 1px);
	height: calc(var(--bh, 800) * 1px);
	transform: translate(-50%, -50%) translateX(calc(var(--px, 0) * 1px)) translateY(calc(var(--dy, 0) * 1px)) scale(var(--s, 1));
	perspective: 2600px;
	perspective-origin: 50% 40%;
}
.book {
	--W: 600px;
	--H: 800px;
	--fs: 17px;
	--lh: 1.9;
	position: absolute;
	left: 0;
	top: 0;
	width: calc(var(--W) * 2);
	height: var(--H);
	transform-style: preserve-3d;
	transform: var(--pose, none);
	transition: transform 1.25s cubic-bezier(.62, .02, .22, 1);
	will-change: transform;
}
.book.no-tr { transition: none; }
.app[data-view="reader"] .book { touch-action: pan-y pinch-zoom; }
.book[data-mode="single"] {
	--W: 390px;
	--H: 700px;
	--fs: 17px;
	--lh: 1.85;
}
.layer {
	position: absolute;
	left: 0;
	top: 0;
	width: calc(var(--W) * 2);
	height: var(--H);
	pointer-events: none;
}
.lay-base { z-index: 1; }
.lay-cast { z-index: 2; overflow: hidden; }
.lay-front { z-index: 3; }
.lay-flap { z-index: 4; filter: drop-shadow(0 0 14px rgba(40, 26, 12, .28)); }
.app[data-theme="night"] .lay-flap { filter: drop-shadow(0 0 16px rgba(0, 0, 0, .6)); }
.layer > .page { pointer-events: auto; }
.lay-flap > .page, .lay-front > .page { pointer-events: none; }
.cast {
	position: absolute;
	left: 0;
	top: 0;
	width: 160px;
	height: 3000px;
	transform-origin: 0 0;
	opacity: 0;
	background: linear-gradient(90deg, rgba(30, 18, 6, .34), rgba(30, 18, 6, .1) 30%, rgba(30, 18, 6, 0));
}
.flipping .cast { opacity: 1; }
.book.flipping .page, .hot { -webkit-user-select: none; user-select: none; }

/* 书页叠起来的厚度 */
.block-edge {
	position: absolute;
	top: 0;
	height: var(--H);
	width: 0;
	z-index: 0;
	pointer-events: none;
}
.edge-l { left: 0; box-shadow: var(--edge-l, none); }
.edge-r { left: calc(var(--W) * 2); box-shadow: var(--edge-r, none); }
.shadow-floor {
	position: absolute;
	left: 1%;
	right: 1%;
	top: 2%;
	bottom: -2%;
	z-index: 0;
	pointer-events: none;
	border-radius: 6px;
	box-shadow: 0 40px 70px -20px rgba(45, 30, 12, .5), 0 18px 30px -12px rgba(45, 30, 12, .35);
	transition: left 1.2s, opacity .6s;
}
.app[data-theme="night"] .shadow-floor { box-shadow: 0 40px 80px -16px rgba(0, 0, 0, .8); }
.book.closed .shadow-floor { left: 50%; }

/* ---------- 书页 ---------- */
.page {
	position: absolute;
	left: 0;
	top: 0;
	width: var(--W);
	height: var(--H);
	overflow: hidden;
	transform-origin: 0 0;
	color: var(--ink);
	font-family: var(--serif);
	font-size: var(--fs);
	line-height: var(--lh);
	-webkit-user-select: text;
	user-select: text;
	contain: layout paint;
}
.page.side-r { transform: translateX(var(--W)); }
.pg-paper {
	position: absolute;
	inset: 0;
	background-color: var(--paper);
	background-image: var(--paper-img);
	background-size: 256px 256px;
}
.pg-gutter {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 64px;
	pointer-events: none;
}
.side-r .pg-gutter { left: 0; background: linear-gradient(90deg, rgba(60, 38, 14, .2), rgba(60, 38, 14, .06) 22%, rgba(60, 38, 14, 0)); }
.side-l .pg-gutter { right: 0; background: linear-gradient(270deg, rgba(60, 38, 14, .2), rgba(60, 38, 14, .06) 22%, rgba(60, 38, 14, 0)); }
.app[data-theme="night"] .side-r .pg-gutter { background: linear-gradient(90deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0)); }
.app[data-theme="night"] .side-l .pg-gutter { background: linear-gradient(270deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0)); }
.side-l .pg-edge, .side-r .pg-edge {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 10px;
	pointer-events: none;
}
.side-r .pg-edge { right: 0; background: linear-gradient(270deg, rgba(60, 38, 14, .1), transparent); }
.side-l .pg-edge { left: 0; background: linear-gradient(90deg, rgba(60, 38, 14, .1), transparent); }

/* 版心（每页的书脊一侧各有半个） */
.pg-bx {
	position: absolute;
	top: 70px;
	height: 670px;
	width: 18px;
	color: var(--zhu);
	font-family: var(--serif);
	pointer-events: none;
}
.side-r .pg-bx { left: 0; border-left: 1.5px solid var(--rule); }
.side-l .pg-bx { right: 0; border-right: 1.5px solid var(--rule); }
.pg-bx svg { position: absolute; left: 0; width: 18px; height: 22px; fill: var(--zhu); opacity: .85; }
.pg-bx .fy1 { top: 104px; }
.pg-bx .fy2 { bottom: 104px; transform: scaleY(-1); }
.pg-bx .bx-t {
	position: absolute;
	top: 136px;
	left: 2px;
	width: 14px;
	writing-mode: vertical-rl;
	font-size: 11px;
	line-height: 14px;
	letter-spacing: .2em;
	white-space: nowrap;
	color: var(--ink-2);
}
.pg-bx .bx-t2 { top: 8px; color: var(--zhu); }
.pg-bx .bx-n { top: auto; bottom: 136px; color: var(--ink-2); }
.side-l .pg-bx .bx-t { left: auto; right: 2px; }
.book[data-mode="single"] .pg-bx { display: none; }

/* 版框 */
.pg-frame {
	position: absolute;
	top: 70px;
	width: 420px;
	height: 670px;
	border: 1.5px solid var(--rule);
	outline: .5px solid var(--rule);
	outline-offset: 3px;
}
.side-r .pg-frame { left: 44px; }
.side-l .pg-frame { left: 136px; }
.book[data-mode="single"] .pg-frame { left: 16px; top: 46px; width: 358px; height: 612px; outline-offset: 2px; }
.pg-frame.no-frame { border-color: transparent; outline-color: transparent; }

/* 正文 */
.pg-body {
	position: absolute;
	inset: 0;
	padding: 18px 18px;
	overflow: hidden;
	text-align: justify;
	font-kerning: none;
	hanging-punctuation: none;
	background-image: var(--jiehang, none);
	background-position: 0 18px;
}
.book[data-mode="single"] .pg-body { padding: 14px 14px; }
.ruled .pg-body { --jiehang: repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--fs) * var(--lh) - 1px), var(--rule-2) calc(var(--fs) * var(--lh) - 1px), var(--rule-2) calc(var(--fs) * var(--lh))); }
.para {
	margin: 0;
	text-indent: 2em;
	hyphens: none;
	word-break: normal;
	line-break: strict;
	overflow-wrap: anywhere;
}
.para.cont { text-indent: 0; }
.sec {
	margin: calc(var(--fs) * var(--lh) * .5) 0 calc(var(--fs) * var(--lh) * .25);
	font-size: calc(var(--fs) * 1.08);
	line-height: calc(var(--fs) * var(--lh) * 1.25);
	font-weight: 700;
	letter-spacing: .04em;
	display: flex;
	align-items: center;
	gap: .55em;
}
.sec:first-child { margin-top: 0; }
.sec .sec-n {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 1.45em;
	height: 1.45em;
	background: var(--zhu);
	color: var(--paper);
	font-size: .78em;
	font-weight: 700;
	line-height: 1;
	border-radius: 2px;
}
.em {
	-webkit-text-emphasis: dot var(--zhu);
	text-emphasis: dot var(--zhu);
	-webkit-text-emphasis-position: under right;
	text-emphasis-position: under right;
}
.anc { border-bottom: 1px dotted var(--zhu); cursor: pointer; }
.anc.lk { border-bottom-color: var(--dian-2); }
.anc:hover { background: var(--rule-2); }

/* 读者的划线 */
.hl { cursor: pointer; }
.hl-zhu { text-decoration: underline wavy var(--zhu); text-decoration-thickness: 1px; text-underline-offset: .32em; -webkit-text-decoration: underline wavy var(--zhu); }
.hl-huang { background: linear-gradient(transparent 32%, var(--huang) 32%, var(--huang) 88%, transparent 88%); }
.hl-dian {
	-webkit-text-emphasis: open circle var(--zhu);
	text-emphasis: open circle var(--zhu);
	-webkit-text-emphasis-position: under right;
	text-emphasis-position: under right;
}
.hl-has-note { position: relative; }
.flash { animation: flash 2.2s ease-out 1; border-radius: 2px; }
@keyframes flash { 0%, 30% { background: rgba(179, 52, 31, .28); } 100% { background: transparent; } }

/* 对照表 */
.duizhao {
	margin: calc(var(--fs) * var(--lh) * .4) 0;
	font-size: calc(var(--fs) * .9);
	line-height: 1.6;
	display: grid;
	grid-template-columns: 5.2em 1.4em 1fr;
	row-gap: .55em;
	text-indent: 0;
	text-align: left;
}
.duizhao .dz-h { font-family: var(--ui); font-size: .72em; letter-spacing: .12em; color: var(--ink-3); padding-bottom: .2em; border-bottom: 1px solid var(--rule-2); }
.duizhao .dz-a { font-weight: 700; color: var(--zhu); letter-spacing: .06em; }
.duizhao .dz-m { color: var(--zhu); opacity: .7; text-align: center; }
.duizhao .dz-b { color: var(--ink); }

/* 本卷所据 */
.srcs { margin-top: calc(var(--fs) * var(--lh) * .5); font-size: calc(var(--fs) * .78); line-height: 1.65; text-indent: 0; text-align: left; }
.srcs-t { font-weight: 700; color: var(--zhu); letter-spacing: .2em; margin: 0 0 .5em; display: flex; align-items: center; gap: .6em; }
.srcs-t::after { content: ''; flex: 1; height: 1px; background: var(--rule); opacity: .6; }
.src { margin: 0 0 .5em; }
.src a { color: var(--ink); text-decoration: none; }
.src a:hover .src-u { color: var(--zhu); text-decoration: underline; }
.src .src-d { font-family: var(--mono); font-size: .9em; color: var(--ink-3); margin-left: .4em; }
.src .src-u { display: block; font-family: var(--mono); font-size: .82em; color: var(--dian-2); word-break: break-all; }
.juan-end {
	margin-top: calc(var(--fs) * var(--lh) * .6);
	text-align: right;
	font-family: var(--brush);
	color: var(--zhu);
	font-size: calc(var(--fs) * 1.15);
	letter-spacing: .3em;
}

/* 卷首（卷名页） */
.chhead {
	position: relative;
	background-color: var(--paper);
	background-image: var(--paper-img);
	background-size: 256px 256px;
	padding: 4px 0 calc(var(--fs) * var(--lh) * .5);
	margin-bottom: calc(var(--fs) * var(--lh) * .5);
	text-indent: 0;
	text-align: left;
	border-bottom: 1px solid var(--rule);
}
.chhead .ch-part { margin: 0; font-family: var(--ui); font-size: 11px; letter-spacing: .3em; color: var(--ink-3); line-height: 1.6; }
.chhead .ch-num { margin: 6px 0 0; font-family: var(--brush); font-size: 46px; line-height: 1.05; color: var(--zhu); font-weight: 400; }
.chhead .ch-title { margin: 6px 0 0; font-size: 34px; line-height: 1.25; font-weight: 900; letter-spacing: .06em; }
.chhead .ch-sub { margin: 6px 0 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); letter-spacing: .08em; }
.chhead .ch-epi { margin: 16px 0 0; font-family: var(--kai); font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.chhead .ch-epi b { display: block; font-weight: 400; font-family: var(--serif); font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.book[data-mode="single"] .chhead .ch-title { font-size: 30px; }

/* 页边：旁注与延伸 */
.pg-margin {
	position: absolute;
	top: 70px;
	width: 112px;
	height: 670px;
	pointer-events: none;
}
.side-r .pg-margin { left: 474px; }
.side-l .pg-margin { left: 14px; }
.book[data-mode="single"] .pg-margin { display: none; }
.mn {
	position: absolute;
	left: 0;
	width: 112px;
	pointer-events: auto;
	opacity: 0;
	transform: translateY(4px);
	animation: mnIn .7s .15s ease-out forwards;
}
@keyframes mnIn { to { opacity: 1; transform: none; } }
.mn-note {
	font-family: var(--kai);
	font-size: 13px;
	line-height: 1.6;
	color: var(--zhu);
	text-align: left;
}
.side-r .mn-note { padding-left: 8px; border-left: 1px solid var(--rule); }
.side-l .mn-note { padding-right: 8px; border-right: 1px solid var(--rule); text-align: right; }
.mn-note .mn-k { display: block; font-family: var(--brush); font-size: 15px; line-height: 1.1; margin-bottom: 2px; opacity: .9; }
.mn-mine { color: var(--dian); }
.mn-note .mn-k .tag-sample { margin: 0 0 0 .45em; font-size: 10px; color: var(--dian-2); vertical-align: .2em; }
/* 示例里只划了线、没写批注的：页边标一个小签 */
.mn-smark {
	font-family: var(--serif);
	font-size: 11px;
	line-height: 1.6;
	color: var(--ink-2);
	cursor: pointer;
	letter-spacing: .06em;
}
.side-r .mn-smark { padding-left: 8px; border-left: 1px dashed var(--dian-2); }
.side-l .mn-smark { padding-right: 8px; border-right: 1px dashed var(--dian-2); text-align: right; }
.mn-smark .tag-sample { margin: 0 .4em 0 0; color: var(--dian-2); }
.side-l .mn-smark .tag-sample { margin: 0 .4em 0 0; }
.mn-smark:hover { color: var(--zhu); }
.side-r .mn-mine { border-left-color: var(--dian-2); }
.side-l .mn-mine { border-right-color: var(--dian-2); }
.mn-link {
	display: block;
	text-decoration: none;
	color: var(--ink);
	background: color-mix(in srgb, var(--paper) 70%, #fff 30%);
	border: 1px solid rgba(31, 54, 87, .25);
	border-radius: 3px;
	overflow: hidden;
	box-shadow: 0 6px 14px -10px rgba(31, 54, 87, .6);
	transition: transform .25s, box-shadow .25s;
}
.app[data-theme="night"] .mn-link { background: #2b2822; border-color: rgba(159, 187, 224, .25); }
.mn-link:hover { transform: translateY(-2px) rotate(-.6deg); box-shadow: 0 12px 20px -12px rgba(31, 54, 87, .8); }
.mn-link .mn-th { display: block; width: 100%; aspect-ratio: 720 / 422; object-fit: cover; background: var(--indigo); }
.mn-link .mn-gl {
	display: grid;
	place-items: center;
	width: 100%;
	aspect-ratio: 720 / 422;
	background: var(--indigo);
	color: #f3ead6;
	font-family: var(--brush);
	font-size: 26px;
	letter-spacing: .1em;
}
.mn-link .mn-tt { display: block; padding: 5px 7px 0; font-size: 12.5px; line-height: 1.35; font-weight: 700; color: var(--dian); }
.mn-link .mn-tt::before { content: '延伸 · '; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.mn-link .mn-d { display: block; padding: 3px 7px 7px; font-size: 11px; line-height: 1.5; color: var(--ink-2); }

/* 页脚（单页模式） */
.pg-foot {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 12px;
	display: flex;
	justify-content: space-between;
	font-family: var(--ui);
	font-size: 11px;
	letter-spacing: .1em;
	color: var(--ink-3);
	pointer-events: none;
	line-height: 1.4;
}
.book[data-mode="spread"] .pg-foot { display: none; }
.pg-notes-chip {
	position: absolute;
	right: 16px;
	top: 14px;
	display: none;
	pointer-events: auto;
	font-family: var(--kai);
	font-size: 13px;
	line-height: 1;
	color: var(--zhu);
	background: var(--rule-2);
	border: 1px solid var(--rule);
	border-radius: 999px;
	padding: 5px 10px;
	cursor: pointer;
}
.book[data-mode="single"] .pg-notes-chip.has, .book[data-script="v"] .pg-notes-chip.has { display: block; }
.book[data-mode="single"] .pg-notes-chip, .book[data-script="v"] .pg-notes-chip { right: auto; left: 50%; top: auto; bottom: 8px; transform: translateX(-50%); padding: 7px 14px; }
.book[data-script="v"] .pg-margin { display: none; }
.anc-dot { position: relative; }
.book[data-mode="single"] .anc::after, .book[data-script="v"] .anc::after {
	content: '';
	position: absolute;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--zhu);
	transform: translate(1px, -2px);
}
.book[data-mode="single"] .anc, .book[data-script="v"] .anc { position: relative; }

/* ---------- 特殊页 ---------- */
.pg-art .pg-frame { border: 0; outline: 0; }
.art-cv { position: absolute; display: block; touch-action: pan-y; }
.side-l .art-cv, .side-r .art-cv { left: 0; top: 0; width: 100%; height: 100%; }
.art-cap {
	position: absolute;
	left: 34px;
	bottom: 30px;
	right: 34px;
	pointer-events: none;
	color: var(--ink-2);
}
.art-cap .ac-part { margin: 0; font-family: var(--ui); font-size: 11px; letter-spacing: .32em; color: var(--ink-3); }
.art-cap .ac-name { margin: 4px 0 0; font-family: var(--brush); font-size: 30px; line-height: 1.2; color: var(--zhu); }
.art-cap .ac-desc { margin: 2px 0 0; font-size: 13px; letter-spacing: .1em; }
.art-hint {
	position: absolute;
	right: 26px;
	top: 22px;
	margin: 0;
	padding: 2px 10px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--paper) 78%, transparent);
	font-family: var(--kai);
	font-size: 13px;
	color: var(--ink-3);
	pointer-events: none;
	opacity: .9;
}
.book[data-mode="single"] .pg-art .art-cv { height: 58%; }
.book[data-mode="single"] .pg-art .art-cap { display: none; }
.pg-art .art-title { display: none; }
.book[data-mode="single"] .pg-art .art-title {
	display: block;
	position: absolute;
	left: 22px;
	right: 22px;
	top: 60%;
}
.book[data-mode="single"] .pg-art .art-title .chhead { border: 0; }
.book[data-mode="single"] .art-hint { top: 14px; right: 16px; }

/* 衬页 */
.pg-endpaper .pg-frame { display: none; }
.pg-endpaper .ep-img { position: absolute; inset: 0; background-size: cover; background-position: center; }
.pg-endpaper .ep-plate {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 170px;
	padding: 20px 14px 16px;
	background: var(--paper);
	border: 1.5px solid var(--zhu);
	outline: .5px solid var(--zhu);
	outline-offset: 3px;
	text-align: center;
	color: var(--zhu);
	box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .5);
}
.ep-plate .ep-k { margin: 0; font-family: var(--ui); font-size: 10px; letter-spacing: .4em; }
.ep-plate .ep-n { margin: 8px 0 6px; font-family: var(--brush); font-size: 40px; line-height: 1; }
.ep-plate .ep-s { margin: 0; font-size: 12px; letter-spacing: .3em; color: var(--ink-2); }

/* 扉页 */
.pg-title .pg-frame { border-width: 2px; }
.tp {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 56px 20px 40px;
}
.tp-k { margin: 0; font-family: var(--ui); font-size: 11px; letter-spacing: .5em; color: var(--ink-3); }
.tp-t {
	margin: 40px 0 0;
	display: flex;
	flex-direction: row-reverse;
	align-items: flex-start;
	gap: 18px;
	font-family: var(--brush);
	font-weight: 400;
	font-size: 56px;
	line-height: 1;
	color: var(--ink);
}
.tp-t span { writing-mode: vertical-rl; letter-spacing: .08em; white-space: nowrap; }
.tp-t .tp-t2 { margin-top: 1.6em; }
.book[data-mode="single"] .tp-t { font-size: 42px; gap: 12px; margin-top: 30px; }
.tp-seal {
	position: absolute;
	left: 50%;
	margin-left: -110px;
	top: 560px;
	width: 46px;
	height: 46px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	place-items: center;
	background: var(--zhu);
	color: var(--paper);
	font-family: var(--brush);
	font-size: 19px;
	line-height: 1;
	border-radius: 3px;
	transform: rotate(-4deg);
	box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3.5px var(--zhu);
}
.book[data-mode="single"] .tp-seal { margin-left: -86px; top: 470px; }
.tp-a { margin: auto 0 0; font-size: 18px; letter-spacing: .5em; }
.tp-a a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--ink-3); }
.tp-a a:hover { color: var(--zhu); border-bottom-color: var(--zhu); }
.tp-y { margin: 10px 0 0; font-family: var(--ui); font-size: 12px; letter-spacing: .3em; color: var(--ink-3); }

/* 编例 */
.fm-t {
	margin: 0 0 calc(var(--fs) * var(--lh) * .6);
	font-family: var(--brush);
	font-size: 34px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--zhu);
	letter-spacing: .3em;
	text-indent: 0;
}
.fm-note .para { font-size: calc(var(--fs) * .92); }

/* 目录 */
.toc { text-indent: 0; text-align: left; font-size: calc(var(--fs) * .92); line-height: 1.5; }
.toc-part { margin: .9em 0 .3em; font-family: var(--ui); font-size: 11px; letter-spacing: .3em; color: var(--ink-3); }
.toc-part b { font-family: var(--serif); font-size: 13px; letter-spacing: .2em; color: var(--zhu); margin-right: .6em; }
.toc a {
	display: grid;
	grid-template-columns: 2.9em 1fr auto;
	align-items: baseline;
	gap: .5em;
	padding: .32em 0;
	color: var(--ink);
	text-decoration: none;
	border-bottom: 1px dashed rgba(91, 81, 69, .22);
}
.toc a:hover { color: var(--zhu); }
.toc a:hover .toc-n { background: var(--zhu); color: var(--paper); }
.toc .toc-n { font-family: var(--brush); color: var(--zhu); font-size: 1.1em; border-radius: 2px; text-align: center; transition: background .2s, color .2s; }
.toc .toc-tt { font-weight: 700; }
.toc .toc-tt small { display: block; font-weight: 400; font-size: .78em; color: var(--ink-3); }
.toc .toc-p { font-family: var(--mono); font-size: .8em; color: var(--ink-3); }
.toc-compass {
	display: inline-flex !important;
	margin-top: 1em;
	border: 1px solid var(--rule) !important;
	padding: .4em .9em !important;
	border-radius: 999px;
	font-size: .9em;
	color: var(--zhu) !important;
	gap: .4em;
	cursor: pointer;
	background: none;
	font-family: inherit;
}

/* 牌记 */
.pg-colophon .pg-frame { border-color: transparent; outline-color: transparent; }
.pj {
	position: absolute;
	left: 50%;
	top: 46%;
	transform: translate(-50%, -50%);
	width: 230px;
	padding: 22px 18px;
	border: 2px solid var(--zhu);
	outline: .5px solid var(--zhu);
	outline-offset: 4px;
	color: var(--zhu);
	text-align: center;
	font-size: 13px;
	line-height: 1.9;
	letter-spacing: .12em;
}
.pj b { display: block; font-family: var(--brush); font-weight: 400; font-size: 26px; line-height: 1.3; letter-spacing: .2em; margin-bottom: 6px; }
.pj-close {
	position: absolute;
	left: 50%;
	bottom: 70px;
	transform: translateX(-50%);
	pointer-events: auto;
}
.pj-egg { position: absolute; left: 30px; right: 30px; bottom: 30px; margin: 0; text-align: center; font-family: var(--kai); font-size: 13px; color: var(--ink-3); letter-spacing: .08em; }
.book[data-script="v"] .pj-egg { writing-mode: horizontal-tb; }

/* 空白页（卷终） */
.pg-blank .pg-frame { border-color: transparent; outline-color: transparent; }
.blank-orn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; opacity: .5; color: var(--zhu); }

/* ---------- 封面 ---------- */
.cover {
	position: absolute;
	left: var(--W);
	top: 0;
	width: var(--W);
	height: var(--H);
	z-index: 8;
	transform-origin: 0 50%;
	transform-style: preserve-3d;
	transform: rotateY(0deg) translateZ(1px);
	transition: transform 1.3s cubic-bezier(.55, .02, .25, 1);
	pointer-events: none;
}
.cover.open { transform: rotateY(-180deg) translateZ(1px); }
.cover.gone { visibility: hidden; }
.cover-face {
	position: absolute;
	inset: 0;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	border-radius: 2px 5px 5px 2px;
	overflow: hidden;
}
.cover-back { transform: rotateY(180deg); border-radius: 5px 2px 2px 5px; }
.cover-front {
	background-color: var(--indigo);
	background-image: var(--cloth-img, none);
	background-size: 220px 220px;
	box-shadow: inset 0 0 60px rgba(0, 0, 0, .35);
}
.cv-sheen {
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at calc(var(--mx, .3) * 100%) calc(var(--my, .2) * 100%), rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 42%);
	mix-blend-mode: soft-light;
	pointer-events: none;
}
.cv-bind { position: absolute; left: 0; top: 0; bottom: 0; width: 46px; }
.cv-bind svg { width: 100%; height: 100%; display: block; }
.cv-slip {
	position: absolute;
	right: 44px;
	top: 40px;
	width: 88px;
	height: 610px;
	background: #efe6d3;
	background-image: var(--paper-img);
	background-size: 256px 256px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .35), inset 0 0 0 4px #efe6d3, inset 0 0 0 5px rgba(179, 52, 31, .55);
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 22px 0 16px;
	color: #1d1813;
}
.cv-slip .cv-t {
	writing-mode: vertical-rl;
	font-family: var(--brush);
	font-size: 38px;
	line-height: 1;
	letter-spacing: .02em;
	margin: 0;
	white-space: nowrap;
}
.cv-slip .cv-s {
	writing-mode: vertical-rl;
	margin: auto 0 0;
	font-family: var(--serif);
	font-size: 12px;
	letter-spacing: .5em;
	color: #6b5f4f;
	white-space: nowrap;
}
.cv-seal {
	position: absolute;
	right: 70px;
	top: 672px;
	width: 34px;
	height: 34px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	place-items: center;
	background: #b3341f;
	color: #f6ead6;
	font-family: var(--brush);
	font-size: 14px;
	line-height: 1;
	border-radius: 2px;
	transform: rotate(3deg);
	box-shadow: inset 0 0 0 1.5px #f6ead6, inset 0 0 0 2.5px #b3341f;
}
.cv-corner { position: absolute; left: 0; width: 26px; height: 26px; background: #d8c9a6; }
.cv-corner.c1 { top: 0; clip-path: polygon(0 0, 100% 0, 0 100%); }
.cv-corner.c2 { bottom: 0; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.cv-lines { position: absolute; inset: 0; opacity: .55; pointer-events: none; }
.book[data-mode="single"] .cv-slip { right: 30px; top: 34px; width: 70px; height: 530px; padding-top: 18px; }
.book[data-mode="single"] .cv-slip .cv-t { font-size: 33px; }
.book[data-mode="single"] .cv-seal { right: 48px; top: 590px; }
.cover-back { background-color: var(--paper); background-image: var(--paper-img); background-size: 256px 256px; }

/* 合上的书：封面的厚度 */
.book.closed .cover-front { box-shadow: inset 0 0 60px rgba(0, 0, 0, .35); }
.book.closed .cover { box-shadow: 2px 2px 0 #e9dfc9, 4px 4px 0 #ddd2bb, 6px 6px 0 #e9dfc9, 8px 8px 0 #d8ccb3, 10px 10px 0 #e3d8c1, 12px 12px 0 #cbbd9f, 14px 15px 22px rgba(40, 26, 12, .45); border-radius: 2px 6px 6px 2px; }
.book.closed .lay-base .side-l, .book.closed .block-edge { visibility: hidden; }
/* 合好放在书桌上时，封面底下的书页、封二都看不见，不必画出来 */
.book.shut .lay-base .page, .book.shut .cover-back { visibility: hidden; }

/* 翻页热区 */
.hot {
	position: absolute;
	top: 0;
	height: var(--H);
	width: 44px;
	z-index: 9;
	cursor: grab;
	touch-action: none;
}
.hot-l { left: 0; }
.hot-r { left: calc(var(--W) * 2 - 44px); }
.book.closed .hot { display: none; }
.hot:active { cursor: grabbing; }

/* ---------- 古籍（竖排）看法 ---------- */
.book[data-script="v"] { --fs: 18px; --lh: 1.75; }
.book[data-script="v"] .pg-frame { top: 118px; height: 622px; }
.book[data-script="v"] .pg-bx { top: 118px; height: 622px; }
.book[data-script="v"] .pg-body {
	writing-mode: vertical-rl;
	text-orientation: mixed;
	padding: 16px 14px;
	text-align: justify;
	background-position: 0 0;
}
.book[data-script="v"].ruled .pg-body {
	--jiehang: repeating-linear-gradient(270deg, transparent 0, transparent calc(var(--fs) * var(--lh) - 1px), var(--rule) calc(var(--fs) * var(--lh) - 1px), var(--rule) calc(var(--fs) * var(--lh)));
	background-position: calc(-1 * 14px) 0;
	background-origin: content-box;
}
.book[data-script="v"] .sec { margin: 0 calc(var(--fs) * var(--lh) * .3) 0 0; }
.book[data-script="v"] .em { -webkit-text-emphasis-position: over right; text-emphasis-position: over right; }
.book[data-script="v"] .hl-dian { -webkit-text-emphasis-position: over right; text-emphasis-position: over right; }
.book[data-script="v"] .hl-zhu { text-underline-position: right; }
.book[data-script="v"] .chhead { border-bottom: 0; border-left: 1px solid var(--rule); padding: 0 0 0 calc(var(--fs) * .8); margin: 0 0 0 calc(var(--fs) * .8); }
.book[data-script="v"] .chhead .ch-epi { margin: 0 14px 0 0; }
.book[data-script="v"] .duizhao { display: block; }
.book[data-script="v"] .duizhao > * { display: inline; }
.book[data-script="v"] .duizhao .dz-b::after { content: '\A'; white-space: pre; }
.book[data-script="v"] .srcs-t::after { width: 1px; height: auto; }
.book[data-script="v"] .src .src-u { display: none; }
.book[data-script="v"] .juan-end { text-align: left; margin: 0 calc(var(--fs) * 1.2) 0 0; }
.book[data-script="v"] .toc a { grid-template-columns: auto auto auto; }
/* 眉批：竖排看法里，作者旁注写在天头 */
.meipi {
	position: absolute;
	top: 14px;
	height: 92px;
	writing-mode: vertical-rl;
	font-family: var(--kai);
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--zhu);
	pointer-events: auto;
	cursor: pointer;
	overflow: hidden;
}
.meipi.lk { color: var(--dian); }
