/* 拼音字典: a thread-bound classical Chinese book (zidian-zh.html), set vertically and read right
   to left; the page engine and its furniture follow ことば帖 (dict-ja.css).
   Laid out in book units (a page is 540 × 740) and scaled. */
:root {
  --wall: #ebe7de;     /* a whitewashed garden wall, 粉墙 */
  --wall-hi: #f7f4ec;
  --wall-lo: #d6d0c3;
  --xuan: #f3eddf;     /* 宣纸 */
  --xuan-2: #e7dfcc;
  --mo: #1f1c19;       /* 墨 */
  --mo-2: #4f4a42;
  --mo-3: #8a8275;
  --zhu: #b0392b;      /* 朱 */
  --zi: #4a2c45;       /* 紫, the rude words */
  --tao: #c0606f;      /* 桃, the sweet ones */
  --cloth: #8f2a20;    /* cinnabar book cloth */
  --py: 'EB Garamond', 'Noto Serif', serif;   /* pinyin: the CJK fonts set ā ē ī loosely */
  --W: 540px;
  --H: 740px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body {
  color: var(--mo); font-family: 'Noto Serif SC', serif; overflow: hidden; -webkit-font-smoothing: antialiased;
  /* lime wash over plaster: broad brush streaks, a fine grain, sun from the upper right where the bamboo stands */
  background-color: var(--wall);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='700'%3E%3Cfilter id='n'%3E%3CfeTurbulence stitchTiles='stitch' type='fractalNoise' baseFrequency='.0035 .018' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .43 0 0 0 0 .38 0 0 0 .45 -.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence stitchTiles='stitch' type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='2'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .33 0 0 0 0 .3 0 0 0 .3 -.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(65% 75% at 78% 20%, rgba(255,247,226,.9), transparent 70%),
    radial-gradient(120% 95% at 50% 50%, transparent 55%, var(--wall-lo) 100%);
  background-size: 100% 100%, 180px 180px, auto, auto;   /* the streaks stretched once: tiled, they showed seams */
  background-repeat: no-repeat, repeat, no-repeat, no-repeat;
  background-attachment: fixed;
}
.bamboo { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.bamboo svg { position: absolute; top: 0; right: 0; height: 100%; width: 100%; fill: #26332c; stroke: #26332c; transform-origin: 50% 100%; }
.bamboo .far { opacity: .085; filter: blur(6px); }
.bamboo .near { opacity: .15; filter: blur(2.4px); }

/* ---------------------------------------------------------------- the book */
.frame { position: fixed; left: 50%; top: 50%; width: calc(var(--W) * 2); height: var(--H); transform-origin: 50% 50%; z-index: 10; }
.frame.single { width: var(--W); clip-path: inset(-40px 0 -220px 0); touch-action: none; }
.book { position: absolute; left: 0; top: 0; width: calc(var(--W) * 2); height: var(--H); perspective: 3800px; }
.block { position: absolute; top: 0; height: 100%; width: var(--W); border-radius: 2px; background: var(--xuan-2); }
.block.l { left: 0; } .block.r { left: var(--W); }
.page, .face { position: absolute; top: 0; width: var(--W); height: var(--H); overflow: hidden; background-color: var(--xuan); }
.slot-l { left: 0; } .slot-r { left: var(--W); }
.page::before, .face::before { /* 宣纸: a soft grain and long faint fibres */
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .27 0 0 0 0 .22 0 0 0 .45 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.01 .12' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .4 0 0 0 0 .3 0 0 0 .5 -.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}
.pg-r::after, .pg-l::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.pg-r::after { background: linear-gradient(90deg, rgba(50,40,20,.12), transparent 8%); }
.pg-l::after { background: linear-gradient(270deg, rgba(50,40,20,.12), transparent 8%); }
.page > *, .face > * { position: absolute; z-index: 1; }
.gutter { position: absolute; left: calc(var(--W) - 1px); width: 2px; top: 0; height: 100%; pointer-events: none; z-index: 60; background: rgba(40,30,15,.15); }
.frame.closed .gutter { display: none; }

/* leaves (pages in mid-turn) turn around the spine, the right edge of the left page */
.leaf { position: absolute; left: 0; top: 0; width: var(--W); height: var(--H); transform-origin: 100% 50%; transform-style: preserve-3d; z-index: 100; }
.leaf .face { left: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.leaf .face.back { transform: rotateY(180deg); }
.leaf .shade { position: absolute; inset: 0; z-index: 30; pointer-events: none; opacity: 0; }
.leaf .front .shade { background: linear-gradient(270deg, rgba(40,30,15,.55), rgba(40,30,15,.15) 40%, transparent); }
.leaf .back .shade { background: linear-gradient(90deg, rgba(40,30,15,.45), rgba(40,30,15,.1) 40%, transparent); }

/* ---------------------------------------------------------------- printed furniture */
/* 版框: a heavy outer line and a fine inner one (四周双边) */
.kuang { inset: 46px 44px 56px; border: 2.2px solid rgba(31,28,25,.82); }
.kuang::before { content: ''; position: absolute; inset: 3px; border: .8px solid rgba(31,28,25,.6); }
/* 版心: the narrow column at the outer edge: title, 鱼尾, section, page number */
.bx { top: 50px; bottom: 60px; width: 34px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 18px; }
.bx > b, .bx > i, .bx > em { writing-mode: vertical-rl; }
.pg-r .bx { right: 48px; border-left: .8px solid rgba(31,28,25,.6); }
.pg-l .bx { left: 48px; border-right: .8px solid rgba(31,28,25,.6); }
.bx b { font: 600 13px/1 'Noto Serif SC', serif; letter-spacing: .3em; color: var(--mo-2); }
.bx .yuwei { writing-mode: horizontal-tb; width: 24px; height: 18px; fill: rgba(31,28,25,.78); stroke: var(--xuan); margin: 4px 0; }
.bx i { font: 400 13px/1 'Noto Serif SC', serif; font-style: normal; letter-spacing: .3em; color: var(--mo-2); }
.bx em { margin-top: auto; padding-bottom: 14px; font: 400 13px/1 'Noto Serif SC', serif; font-style: normal; letter-spacing: .15em; color: var(--mo-2); }
.endp .bx, .title .bx { display: none; }

.seal { display: grid; place-items: center; color: var(--xuan); background: var(--sc, var(--zhu)); font: 900 26px/1 'Noto Serif SC', serif; filter: url(#stamp); }
.seal.sq { width: 54px; height: 54px; border-radius: 4px; box-shadow: inset 0 0 0 3px var(--sc, var(--zhu)), inset 0 0 0 5px var(--xuan); }
.seal.small { width: 24px; height: 24px; font-size: 13px; border-radius: 3px; box-shadow: none; }

/* 米字格: copybook squares, vermilion border, dashed cross and diagonals */
.sq.mi { position: relative; display: grid; place-items: center; border: 1.6px solid rgba(176,57,43,.75); transition: background .2s;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cg stroke='%23b0392b' stroke-opacity='.4' stroke-width='.6' stroke-dasharray='3 3' vector-effect='non-scaling-stroke'%3E%3Cpath d='M0 0L100 100M100 0L0 100M50 0V100M0 50H100'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.sq.mi span { font-family: 'Ma Shan Zheng', cursive; color: var(--mo); line-height: 1; display: inline-block; filter: url(#brush); transition: color .2s; }

/* ---------------------------------------------------------------- endpaper, cover */
.endpaper { inset: 0; }
.endpaper svg { width: 100%; height: 100%; }
/* ---------------------------------------------------------------- the cover: cinnabar cloth */
.cover { inset: 0; background: var(--cloth); overflow: hidden; }
.cover > * { position: absolute; }
.cv-cloth { inset: 0;   /* woven threads, a slow mottle in the dye, light from the upper left, rubbed corners */
  background:
    repeating-linear-gradient(0deg, rgba(255,225,200,.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(40,0,0,.10) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .15 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .02 0 0 0 0 0 0 0 0 .5 -.12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(75% 55% at 38% 26%, rgba(255,180,140,.20), transparent 70%),
    radial-gradient(55% 45% at 80% 92%, rgba(30,0,0,.30), transparent 70%),
    radial-gradient(70px 70px at 100% 0, rgba(230,170,140,.35), transparent 70%),
    radial-gradient(70px 70px at 100% 100%, rgba(230,170,140,.3), transparent 70%);
  background-size: auto, auto, 220px 220px, 100% 100%, auto, auto, auto, auto; }
.cover-art { inset: 0; width: 100%; height: 100%; }
.cv-slip { left: 56px; top: 58px; width: 96px; height: 352px; display: grid; place-items: center;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 0 0 0 .25 -.08'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), linear-gradient(170deg, #f3ecda, #e9dfc6);
  box-shadow: 0 1px 2px rgba(40,0,0,.5), 0 6px 14px -6px rgba(40,0,0,.45); }
.cv-slip::before { content: ''; position: absolute; inset: 7px; border: 1.5px solid rgba(29,27,25,.75); outline: 1px solid rgba(29,27,25,.45); outline-offset: -5px; }
.cv-slip h1 { margin: 0; writing-mode: vertical-rl; font: 400 58px/1 'Ma Shan Zheng', cursive; letter-spacing: .1em; color: #1d1b19; }
.cv-foot { left: 56px; bottom: 54px; margin: 0; font: italic 15px 'EB Garamond', serif; letter-spacing: .05em; color: rgba(248,222,200,.62); }
.binding { right: 0; top: 0; width: 60px; height: 100%; }

/* ---------------------------------------------------------------- title page (内封) */
.tp-rule { top: 76px; height: 410px; width: 0; border-left: .8px solid rgba(31,28,25,.55); }
.tp-rule.r { right: 158px; } .tp-rule.l { left: 158px; }
.tp-title { right: 214px; top: 92px; margin: 0; width: 112px; text-align: center; writing-mode: vertical-rl; font: 400 92px/1 'Ma Shan Zheng', cursive; letter-spacing: .02em; filter: url(#brush); }
.tp-title span { display: inline-block; }
.tp-side { top: 96px; margin: 0; writing-mode: vertical-rl; font: 400 17px/1 'Noto Serif SC', serif; letter-spacing: .32em; color: var(--mo-2); }
.tp-side.r { right: 104px; } .tp-side.l { left: 104px; }
.tp-seal { left: 96px; top: 410px; }
.tp-how { left: 64px; right: 64px; bottom: 66px; margin: 0; text-align: center; font: 400 13px/1.6 'Noto Serif SC', serif; color: var(--mo-3); }
.tp-how b { color: var(--zhu); font-weight: 600; }

/* ---------------------------------------------------------------- contents (目录) */
.toc { top: 74px; bottom: 92px; writing-mode: vertical-rl; display: flex; flex-direction: column; }
.pg-r .toc { right: 96px; left: 60px; } .pg-l .toc { right: 64px; left: 96px; }
.toc .ttl { font: 400 44px/1 'Ma Shan Zheng', cursive; margin-left: 12px; filter: url(#brush); }
.toc .sec { font: 600 16px/1 'Noto Serif SC', serif; letter-spacing: .25em; color: var(--c); margin: 0 4px 0 10px; display: flex; align-items: center; gap: 10px; }
.toc .sec i { font: italic 13px 'EB Garamond', serif; letter-spacing: .04em; color: var(--mo-3); }
.toc .ent { display: flex; align-items: center; width: 22px; font: 400 16px/1 'Noto Serif SC', serif; letter-spacing: .14em; cursor: pointer; padding: 0 2px; border-radius: 2px; }
.toc .ent:hover { background: rgba(176,57,43,.08); color: var(--zhu); }
.toc .ent .dots { flex: 1; margin: 10px 0; border-right: 2px dotted rgba(31,28,25,.3); align-self: center; width: 0; }
.toc .ent .pn { font-size: 14px; color: var(--mo-2); }
.toc .ent .seal.small { margin-bottom: 8px; writing-mode: horizontal-tb; }
.toc-foot { left: 96px; right: 70px; bottom: 26px; margin: 0; text-align: center; font: italic 14px 'EB Garamond', serif; color: var(--mo-3); }
.toc-foot b { color: var(--zhu); font-weight: 500; }

/* ---------------------------------------------------------------- tone chart (声调表) */
.ch-title { right: 100px; top: 84px; margin: 0; writing-mode: vertical-rl; font: 400 64px/1 'Ma Shan Zheng', cursive; letter-spacing: .1em; filter: url(#brush); }
.ch-sub { right: 172px; top: 92px; margin: 0; writing-mode: vertical-rl; font: 400 15px/1 'Noto Serif SC', serif; letter-spacing: .3em; color: var(--mo-2); }
.chart.curves { left: 56px; top: 300px; width: 400px; cursor: pointer; overflow: visible; }
.chart .lv { stroke: rgba(176,57,43,.28); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .lvn { font: 400 12px var(--py); fill: var(--mo-3); }
.chart .curve { fill: none; stroke: var(--mo); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s, stroke-width .2s; }
.chart .lab { font: italic 22px var(--py); fill: var(--mo-2); }
.chart .labz { font: 400 24px 'Ma Shan Zheng', cursive; fill: var(--mo); }
.chart .t { cursor: pointer; }
.chart .t:hover .curve, .chart .t.on .curve { stroke: var(--zhu); stroke-width: 6.5; }
.chart .t.on .labz, .chart .t.on .lab { fill: var(--zhu); }
.ch-en { left: 70px; right: 104px; bottom: 82px; margin: 0; font: italic 16px/1.45 'EB Garamond', serif; color: var(--mo-2); }
.ch-en b { font-style: normal; color: var(--zhu); font-weight: 500; }
.chart.quad { top: 150px; right: 70px; left: 100px; display: flex; flex-direction: row-reverse; justify-content: space-between; }
.quad .t { width: 92px; display: flex; flex-direction: column; align-items: center; gap: 16px; cursor: pointer; }
.quad .sq.mi { width: 92px; height: 92px; }
.quad .sq.mi span { font-size: 72px; }
.quad .t.on .sq.mi, .quad .t:hover .sq.mi { background-color: rgba(176,57,43,.07); }
.quad .t.on .sq.mi span { color: var(--zhu); }
.qpy { display: flex; align-items: center; gap: 4px; font: italic 22px var(--py); color: var(--mo-2); }
.qn { writing-mode: vertical-rl; font: 600 17px/1 'Noto Serif SC', serif; letter-spacing: .3em; color: var(--zhu); margin-top: 6px; }
.qd { font: italic 14px/1.25 'EB Garamond', serif; text-align: center; color: var(--mo-3); }
.q-en { left: 100px; right: 70px; bottom: 82px; margin: 0; font: italic 16px/1.45 'EB Garamond', serif; color: var(--mo-2); }
.q-en b { font-style: normal; color: var(--zhu); font-weight: 500; }

/* tone shapes beside the pinyin */
.tone { width: 13px; height: 16px; overflow: visible; }
.tone .grid { stroke: rgba(31,28,25,.35); stroke-width: 1; fill: none; }
.tone .c { stroke: var(--zhu); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tone .dot { fill: var(--zhu); }

/* ---------------------------------------------------------------- headword page (right) */
.hw-sec { right: 98px; top: 80px; margin: 0; writing-mode: vertical-rl; font: 600 14px/1 'Noto Serif SC', serif; letter-spacing: .32em; color: var(--c); }
.hw-col { right: 128px; top: 80px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; cursor: pointer; }
.zi { display: flex; flex-direction: row-reverse; align-items: center; gap: 14px; }
.zi .sq.mi { width: var(--s); height: var(--s); }
.zi .sq.mi span { font-size: calc(var(--s) * .8); }
.zi.on .sq.mi { background-color: rgba(176,57,43,.08); }
.zi.on .sq.mi span, .hw-col.whole .sq.mi span { color: var(--zhu); }
.zpy { display: flex; flex-direction: column; align-items: center; gap: 4px; font: italic 22px var(--py); color: var(--mo-2); min-width: 48px; }
.zi.on .zpy { color: var(--zhu); }
.hw-seal { left: 80px; top: 82px; }
.feel { left: 82px; top: 168px; display: flex; flex-direction: column; gap: 6px; }
.feel b { font: 400 40px/1 'Ma Shan Zheng', cursive; color: var(--c); filter: url(#brush); writing-mode: vertical-rl; letter-spacing: .1em; }
.feel i { font: italic 16px 'EB Garamond', serif; color: var(--mo-2); }
.gloss { left: 80px; bottom: 88px; width: 196px; }
.gloss p { margin: 0; }
.gloss .pyline { font: 500 28px/1.1 var(--py); color: var(--mo); }
.gloss .pron { margin-top: 6px; font: 400 14px 'Noto Serif SC', serif; color: var(--mo-3); }
.gloss .pron span { font: italic 18px var(--py); color: var(--mo-2); }
.gloss .pron b { color: var(--zhu); font-weight: 500; }
.gloss .en { margin-top: 12px; font: 400 23px/1.2 'EB Garamond', serif; color: var(--mo-2); }

/* ---------------------------------------------------------------- notes page (left) */
/* 朱丝栏: vermilion column rules; each line of text is one column, 44 units wide */
.cols { right: 47px; top: 50px; width: 400px; height: 404px; margin: 0; padding: 20px 0 0; writing-mode: vertical-rl;
  font: 400 21px/44px 'Noto Serif SC', serif; letter-spacing: .14em; color: var(--mo);
  background: repeating-linear-gradient(to left, transparent 0 43px, rgba(176,57,43,.42) 43px 44px); }
.cols p { margin: 0; min-block-size: 0; }
.cols .lb { font-weight: 600; color: var(--zhu); letter-spacing: .05em; }
.cols small { font-size: 14px; color: var(--mo-3); margin: 0 .2em; letter-spacing: .1em; }
.cols .ex { font-size: 22px; transition: color .2s; }
.cols .ex.on { color: var(--zhu); }
.act { appearance: none; background: none; border: 1px solid rgba(176,57,43,.55); border-radius: 3px; padding: 6px 0; width: 30px; margin: 8px 0 0; cursor: pointer; color: var(--zhu); font: 600 17px/1 'Noto Serif SC', serif; writing-mode: vertical-rl; display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; transition: background .2s, color .2s; }
.act:hover { background: var(--zhu); color: var(--xuan); }
.act .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.act.rec { background: var(--zhu); color: var(--xuan); }
.act.rec .dot { animation: breathe 1s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.7); opacity: .4; } }
.lower { left: 92px; right: 66px; top: 470px; bottom: 70px; border-top: .8px solid rgba(31,28,25,.45); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.lower p { margin: 0; }
.mean { font: 500 25px/1.15 'EB Garamond', serif; color: var(--mo); }
.t-note { font: italic 15px/1.35 'EB Garamond', serif; color: var(--mo-2); }
.ex-mood { font: italic 13.5px/1.3 'EB Garamond', serif; color: var(--mo-3); }
.ex-py { font: italic 16px/1.3 var(--py); color: var(--mo-2); margin-top: 4px !important; }
.ex-en { font: 400 15.5px/1.3 'EB Garamond', serif; color: var(--mo-2); }
.heard { min-height: 24px; font: 400 16px 'Noto Serif SC', serif; color: var(--mo-2); }
.heard .ok { color: var(--zhu); }
/* the teacher's 朱批: a vermilion brush circle round 甚好 */
.mark { left: 104px; top: 290px; width: 120px; height: 120px; opacity: 0; pointer-events: none; }
.mark.shown { opacity: 1; }
.mark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mark path { fill: none; stroke: var(--zhu); stroke-width: 5; stroke-linecap: round; filter: url(#brush); opacity: .85; }
.mark > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; font: 400 40px/1 'Ma Shan Zheng', cursive; color: var(--zhu); filter: url(#brush); }
.mark > span span { display: inline-block; }

/* ---------------------------------------------------------------- colophon (牌记) */
.colo { top: 130px; right: 120px; writing-mode: vertical-rl; font: 400 17px/2.4 'Noto Serif SC', serif; letter-spacing: .18em; color: var(--mo-2); }
.colo b { font: 400 36px/2 'Ma Shan Zheng', cursive; color: var(--mo); letter-spacing: .1em; }
.colo-seal { right: 130px; bottom: 130px; }
.colo-box { top: 116px; bottom: 116px; right: 90px; width: 320px; border: 1px solid rgba(31,28,25,.5); }

/* ---------------------------------------------------------------- thumb index on the fore-edge (left) */
.tabs { position: absolute; left: -30px; top: 80px; display: flex; flex-direction: column; gap: 12px; z-index: -1; }
.tab { appearance: none; width: 42px; height: 66px; border: 0; border-radius: 4px 0 0 4px; padding: 0 12px 0 0; cursor: pointer; color: var(--xuan); background: var(--tc, var(--mo-2)); font: 600 15px/1 'Noto Serif SC', serif; letter-spacing: .15em; writing-mode: vertical-rl; display: grid; place-items: center; box-shadow: inset -6px 0 8px rgba(0,0,0,.18); transition: transform .2s; opacity: .88; }
.tab:hover, .tab.on { transform: translateX(-6px); opacity: 1; }
.tab.on { background: var(--zhu); }
.frame.closed .tabs, .frame.single .tabs { display: none; }

/* ---------------------------------------------------------------- the bookmark ribbon (书签) */
.ribbon { position: absolute; left: 0; top: 0; overflow: visible; z-index: 70; pointer-events: none; filter: drop-shadow(1px 2px 1.5px rgba(0,0,0,.3)); }
.ribbon .band { pointer-events: visibleStroke; cursor: pointer; }
.ribbon .hit { pointer-events: all; cursor: pointer; }
.markbtn { position: fixed; right: 18px; bottom: 16px; z-index: 20; appearance: none; background: none; border: 1px solid rgba(31,28,25,.22); border-radius: 999px; color: rgba(31,28,25,.7); cursor: pointer; padding: 7px 14px; font: 500 15px 'EB Garamond', serif; letter-spacing: .04em; display: flex; gap: 8px; align-items: baseline; transition: color .2s, border-color .2s; }
.markbtn b { font: 600 15px 'Noto Serif SC', serif; color: var(--zhu); }
.markbtn:hover { color: var(--mo); border-color: rgba(31,28,25,.55); }
.markbtn[hidden], .tocbtn { display: none; }
.markbtn.on { border-color: rgba(176,57,43,.5); }

/* ---------------------------------------------------------------- around the book */
.nav { position: fixed; top: 50%; z-index: 20; appearance: none; background: none; border: 1px solid rgba(31,28,25,.22); border-radius: 999px; color: rgba(31,28,25,.7); cursor: pointer; display: flex; align-items: center; gap: 8px; transform: translateY(-50%); transition: color .2s, border-color .2s; padding: 9px 16px; font: 500 16px 'EB Garamond', serif; letter-spacing: .06em; }
.nav:hover { color: var(--mo); border-color: rgba(31,28,25,.55); }
.nav .a { font-size: 22px; line-height: 1; }
.nav.fwd { left: 18px; } .nav.back { right: 18px; }
.nav[disabled] { opacity: .25; cursor: default; }
.hint { position: fixed; left: 0; right: 0; bottom: 30px; margin: 0; text-align: center; z-index: 20; font: italic 15px 'EB Garamond', serif; color: rgba(31,28,25,.5); letter-spacing: .04em; }
.hint span { font: 400 15px 'Noto Serif SC', serif; font-style: normal; }
.credit { position: fixed; left: 0; right: 0; bottom: 8px; margin: 0; text-align: center; z-index: 20; font: italic 13px 'EB Garamond', serif; color: rgba(31,28,25,.5); letter-spacing: .04em; pointer-events: none; }
.credit a { color: var(--zhu); text-decoration: none; border-bottom: 1px solid rgba(176,57,43,.35); pointer-events: auto; }
.credit a:hover { border-color: var(--zhu); }

/* ---------------------------------------------------------------- one page at a time (phones, portrait) */
.frame.tall .headword .hw-col, .frame.tall .headword .hw-sec { translate: 0 var(--dy, 0px); }
.frame.tall .notes-page .lower { top: calc(470px + var(--dy, 0px) * 1.2); }
.frame.tall .notes-page .cols { height: calc(404px + var(--dy, 0px) * 1.2); }
body.single .bamboo .near { opacity: .11; }
body.single .credit { bottom: auto; top: calc(10px + env(safe-area-inset-top)); font-size: 12px; }
body.single .hint { bottom: calc(76px + env(safe-area-inset-bottom)); font-size: 14px; }
/* a bottom bar: ‹ Next · 目录 · 签 · Back › */
body.single .nav, body.single .tocbtn, body.single .markbtn {
  top: auto; bottom: calc(14px + env(safe-area-inset-bottom)); transform: none; height: 44px; padding: 0 16px;
  background: rgba(243,237,223,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
body.single .nav.fwd { left: 12px; } body.single .nav.back { right: 12px; }
body.single .tocbtn:not([hidden]) {
  display: grid; place-items: center; position: fixed; z-index: 20; left: 50%; margin-left: -58px; width: 54px; appearance: none;
  border: 1px solid rgba(31,28,25,.22); border-radius: 999px; color: rgba(31,28,25,.75); font: 600 15px 'Noto Serif SC', serif; letter-spacing: .1em; padding: 0; cursor: pointer;
}
body.single .markbtn { left: 50%; right: auto; margin-left: 4px; width: 54px; justify-content: center; padding: 0; align-items: center; }
body.single .markbtn .t { display: none; }
body.single .markbtn b { font-size: 17px; }
body.single .markbtn.on { background: var(--zhu); border-color: var(--zhu); }
body.single .markbtn.on b { color: var(--xuan); }
@media (max-width: 360px) { body.single .nav { padding: 0 12px; font-size: 15px; } }

/* a page whose ink hasn't settled yet (inkIn() reveals it) */
.pre .sq span, .pre .tp-title span, .pre .hw-seal, .pre .tp-seal, .pre .colo-seal, .pre .ent, .pre .cols p, .pre .chart .t { opacity: 0; }

/* back to the bookshelf (shelf.html), top-left */
.shelf-link { position: fixed; top: 14px; left: 18px; z-index: 30; display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px 6px; border: 1px solid rgba(30,26,22,.22); border-radius: 999px; color: rgba(30,26,22,.7); text-decoration: none; font: 500 15px 'EB Garamond', serif; letter-spacing: .05em; transition: color .2s, border-color .2s; }
.shelf-link .a { font-size: 19px; line-height: 1; }
.shelf-link:hover { color: rgba(30,26,22,1); border-color: rgba(30,26,22,.55); }
body.single .shelf-link { top: calc(6px + env(safe-area-inset-top)); left: 10px; padding: 3px 10px 4px; font-size: 13px; background: rgba(255,255,255,.35); }
body.single .credit { left: 80px; right: 12px; text-align: right; }

/* no mic (window.NO_MIC, a static deploy): no say-it button, no R hint */
.no-mic .act.say, .no-mic .mic-only { display: none; }
