/* 一竿 · 官网长卷（方案 A）。桌面是一卷从右往左展开的手卷（.juan），手机是从上往下的立轴（.zhou）。
   页面由 tools/site_scroll.py 生成；字体子集与 @font-face 在各页的 <style> 里，印章是 tools/seal_impress.py 盖的印蜕。 */
:root {
  --paper: #EEE8DA; --ink: #211C16; --mid: #574C3F; --light: #85786A; --red: #A83A2B;
  --hair: rgba(33, 28, 22, .12);
  --kai: yg-kai, "Kaiti SC", "Kaiti TC", STKaiti, KaiTi, serif;
  --title: yg-title, yg-kai, "Kaiti SC", "Kaiti TC", serif;
  --quote: yg-quote, yg-kai, "Kaiti SC", "Kaiti TC", serif;
  --mei: yg-mei, yg-kai, "Kaiti SC", "Kaiti TC", serif;
  --latin: yg-latin, "EB Garamond", Garamond, Georgia, serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #DCD2BE; color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { font-family: var(--kai); }
a { color: inherit; }
img, video { display: block; }
img { width: auto; height: auto; }                 /* the width and height attributes give the shape, the styles the size */
.qh { font-family: var(--title); font-weight: normal; }
.yr { font-family: var(--quote); }
.kai { font-family: var(--kai); }
.xing { font-family: var(--mei); }
.gm { font-family: var(--latin); }
.sc { font-family: var(--latin); text-transform: uppercase; letter-spacing: .14em; }
.col { position: absolute; writing-mode: vertical-rl; text-orientation: mixed; z-index: 7; }

/* pictures fetched as the scroll gets near come up softly */
.lz { opacity: 0; transition: opacity .7s ease; }
.lz.in { opacity: 1; }
.paint.lz.in { opacity: 1; } .paint.lz.in[style*="opacity:.9"] { opacity: .9; } .paint.lz.in[style*="opacity:.55"] { opacity: .55; }

/* a seal impression (an image) */
.yin { display: block; pointer-events: none; }

/* the app: its icon, its name */
.brand { display: flex; align-items: center; gap: .55em; color: var(--ink); text-decoration: none; }
.appicon { border-radius: 22.5%; box-shadow: 0 0 0 .5px rgba(33,28,22,.18), 0 2px 6px rgba(40,30,20,.14); }
.brand .appicon { width: 2.1em; height: 2.1em; }
.brand .name.qh { font-size: 1.6em; letter-spacing: .08em; line-height: 1; }
.brand .name.sc { font-size: 1.02em; }
.badge { display: inline-block; line-height: 0; }
.fine { font-size: 13px; line-height: 1.8; letter-spacing: 1.5px; color: var(--light); margin-top: 12px; }
.fine.kai { letter-spacing: 2px; }
html[lang="en"] .fine { font-size: 14px; letter-spacing: .2px; font-style: italic; }

/* which of the two scrolls: the hand scroll on a wide, tall-enough screen, the hanging scroll otherwise */
.juan { display: none; }
@media (min-width: 821px) and (min-height: 521px) and (orientation: landscape) {
  .juan { display: block; } .zhou { display: none; }
}

/* ===================================================================================== 桌面 · 手卷 */
.juan { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.strip { position: absolute; left: 0; top: 0; will-change: transform; }
.paper { display: flex; flex-direction: row-reverse; width: max-content; height: 900px; zoom: var(--z, 1); }
.p { position: relative; width: 1440px; height: 900px; overflow: hidden; flex: none; background-color: #EFE7D5; }
.p.wide { width: 2400px; } .p.end { width: 1000px; }
.p::before { content: ""; position: absolute; inset: 0; background: url("img/grain.webp"); background-size: 512px; opacity: .22; mix-blend-mode: multiply; pointer-events: none; z-index: 5; }
/* the silk mounting above and below, as on a real 手卷 */
.p::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 26px; background: linear-gradient(#C9BCA2, #D8CCB3); box-shadow: 0 1px 0 rgba(0,0,0,.08); z-index: 6; }
.band { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: linear-gradient(#D8CCB3, #C9BCA2); z-index: 6; }
.mount { position: absolute; right: 0; top: 26px; bottom: 26px; width: 34px; background: repeating-linear-gradient(45deg, #C7B79A 0 6px, #CDBEA2 6px 12px); box-shadow: inset 1px 0 0 rgba(0,0,0,.12); z-index: 6; }
.paint { position: absolute; top: 26px; bottom: 26px; object-fit: cover; height: 848px; }
.fade-r { -webkit-mask-image: linear-gradient(to right, #000 78%, transparent); mask-image: linear-gradient(to right, #000 78%, transparent); }
.fade-lr { -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent); }
.t { font-size: 120px; line-height: 1; top: 120px; right: 100px; }
.q { font-size: 34px; letter-spacing: 12px; line-height: 1.75; top: 132px; color: var(--ink); }
.b { font-size: 20px; letter-spacing: 6px; line-height: 2.05; top: 140px; color: var(--mid); }
.no { position: absolute; top: 92px; right: 104px; z-index: 7; font: 13px/1 var(--kai); letter-spacing: 3px; color: var(--light); }
.shadow { filter: drop-shadow(0 26px 30px rgba(40,30,20,.22)); }
.cta { position: absolute; z-index: 7; }
.cta .badge img { margin-left: auto; }
.cta-in { margin-top: 30px; }
.cta-in .fine { margin-top: 10px; }
/* English: the brush title stays, the words run across */
.en { position: absolute; z-index: 7; font-family: var(--latin); color: var(--mid); }
.en h2 { font: 400 15px/1.2 var(--latin); letter-spacing: 3px; text-transform: uppercase; color: var(--red); margin-bottom: 14px; }
.en .q { position: static; font: italic 400 31px/1.28 var(--latin); letter-spacing: 0; color: var(--ink); margin-bottom: 16px; }
.en .b { position: static; font: 400 19px/1.55 var(--latin); letter-spacing: 0; color: var(--mid); }
.en .b + .b { margin-top: 10px; }

/* the bar on top and the rod below stay while the scroll moves */
.top { position: absolute; left: 0; right: 0; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  padding: calc(38px * var(--z, 1)) calc(56px * var(--z, 1)) 0; font-size: calc(15px * var(--z, 1)); color: var(--mid); pointer-events: none; }
.top > * { pointer-events: auto; }
.links { display: flex; gap: 1.6em; letter-spacing: 3px; align-items: center; }
.links a { text-decoration: none; padding-bottom: 3px; border-bottom: 1.5px solid transparent; }
.links a.on { color: var(--ink); border-bottom-color: var(--red); }
.links .lang { letter-spacing: 1px; margin-left: .6em; } .links .lang a { border: 0; } .links .lang b { font-weight: normal; color: var(--ink); }
html[lang="en"] .links { letter-spacing: 1px; font-family: var(--latin); font-size: 1.05em; }
.axis { position: absolute; left: calc(56px * var(--z, 1)); right: calc(56px * var(--z, 1)); bottom: calc(52px * var(--z, 1)); height: calc(30px * var(--z, 1)); z-index: 20; font-size: calc(13px * var(--z, 1)); }
.axis .rod { position: absolute; left: 0; right: 0; top: 1.08em; height: 1.5px; background: rgba(33,28,22,.35); }
.axis .m { position: absolute; top: 0; transform: translateX(-50%); text-align: center; color: var(--light); letter-spacing: 2px; white-space: nowrap; cursor: pointer; background: none; border: 0; font: inherit; }
.axis .m i { display: block; width: .7em; height: .7em; border-radius: 50%; background: #E9E0CC; border: 1.5px solid rgba(33,28,22,.5); margin: .7em auto .45em; }
.axis .m.hi i { border-color: var(--red); }
.axis .m.on { color: var(--ink); } .axis .m.on i { background: var(--red); border-color: var(--red); }
.axis .go { position: absolute; left: 0; top: -1.9em; color: var(--mid); letter-spacing: 2px; transition: opacity .6s; }
.axis .go.gone { opacity: 0; }
html[lang="en"] .axis { font-family: var(--latin); } html[lang="en"] .axis .m { letter-spacing: .5px; }

/* 做饵 · 开卷有鱼: a recording inside the phone's own frame */
.device { position: absolute; z-index: 7; }
.device > img.frame { position: relative; width: 100%; height: auto; z-index: 2; pointer-events: none; }
.device > video { position: absolute; z-index: 1; object-fit: cover; background: #1A1E22; }
.device.iphone > video { left: 5.1%; top: 2.2%; width: 89.8%; height: 95.6%; border-radius: 12.9% / 5.9%; }
.device.duo > video { left: 3.88%; top: 5.34%; width: 92.24%; height: 89.32%; border-radius: 3.6% / 5.1%; background: #E6DCC8; }

/* 起竿 · 破框: the crab comes out of the picture when the scroll gets there */
.frame-pic { position: absolute; z-index: 7; padding: 14px; background: #D6C9AE; box-shadow: 0 14px 34px rgba(40,30,20,.2); }
.frame-pic > div { width: 100%; height: 100%; background-size: cover; background-color: #C9CFC6; position: relative; overflow: hidden; }
.ripple { position: absolute; left: 40px; bottom: 40px; }
.crab { position: absolute; z-index: 8; filter: drop-shadow(0 22px 22px rgba(20,30,40,.28)); transform-origin: 55% 70%; }
.js .crab { transform: translate(14%, 30%) scale(.5) rotate(10deg); transition: transform 1.25s cubic-bezier(.18,.9,.22,1.12) .15s, opacity .6s .15s; }
.js .crab.lz.in { opacity: 0; } .js .go .crab.lz.in { opacity: 1; }
.js .go .crab { transform: none; }
.js .ripple ellipse { transform-box: fill-box; transform-origin: center; transform: scale(.3); opacity: 0; }
.js .go .ripple ellipse { animation: ring 2.4s ease-out forwards; }
.js .go .ripple ellipse:nth-child(2) { animation-delay: .25s; } .js .go .ripple ellipse:nth-child(3) { animation-delay: .5s; }
@keyframes ring { 0% { transform: scale(.3); opacity: 0; } 15% { opacity: .95; } 100% { transform: scale(1); opacity: .85; } }

/* 天时 · 四条屏 */
.strip4 { position: absolute; top: 150px; width: 232px; height: 584px; padding: 10px; background: #D9CDB3; box-shadow: 0 10px 26px rgba(60,40,20,.14); z-index: 7; }
.strip4 video { width: 100%; height: 100%; object-fit: cover; background: #B9C3C2; }
.strip4::after { content: ""; position: absolute; left: 50%; top: -34px; width: 1px; height: 34px; background: rgba(33,28,22,.35); }
.rod4 { position: absolute; top: 116px; height: 1.5px; background: linear-gradient(90deg, #6B4A30, #8C6A44 50%, #6B4A30); z-index: 7; }

/* 心猿 · 今物 cards, 入谱 cards */
.card { position: absolute; width: 340px; height: 620px; background: #F4EEE2; z-index: 7; box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 14px 34px rgba(60,40,20,.12); }
.card .nm { right: 26px; top: 30px; font-size: 54px; line-height: 1.05; }
.card .ln { right: 108px; top: 38px; font-size: 21px; letter-spacing: 5px; line-height: 1.9; height: 300px; color: var(--ink); }
.card .foot { position: absolute; left: 22px; right: 22px; bottom: 22px; border-top: 1px solid var(--hair); padding-top: 12px; font: 13px/1.5 var(--kai); color: var(--light); letter-spacing: 2px; display: flex; justify-content: space-between; }
.card .enl { position: absolute; left: 22px; right: 22px; top: 290px; font: italic 18px/1.4 var(--latin); color: var(--ink); }
.fishcard { position: absolute; width: 230px; height: 250px; background: #F3EDE0; box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 8px 24px rgba(60,40,20,.08); z-index: 7; }
.fishcard > img:not(.yin) { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 166px; }
.fishcard .n { right: 14px; top: 18px; font-size: 26px; }

/* 池塘: a moon window, the fish swimming in it */
.moon { position: absolute; width: 600px; height: 600px; border-radius: 50%; z-index: 7; overflow: hidden; background: #D8D6C8;
  box-shadow: 0 0 0 14px #DCCFB4, 0 0 0 15px rgba(33,28,22,.22), 0 22px 44px 14px rgba(60,40,20,.16); }
.moon > img { width: 100%; height: 100%; object-fit: cover; }
.pool { position: absolute; left: 0; top: 0; width: 600px; height: 600px; transform-origin: 0 0; }
.fish { position: absolute; left: 0; top: 0; offset-rotate: auto; animation: swim var(--d, 40s) linear infinite; animation-delay: var(--at, 0s); animation-play-state: paused; }
.fish img { width: 100%; height: auto; transform: scaleX(-1); filter: drop-shadow(0 9px 6px rgba(40,50,60,.22)); animation: wag 1.6s ease-in-out infinite alternate; animation-play-state: paused; }
.swim .fish, .swim .fish img { animation-play-state: running; }
@keyframes swim { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes wag { from { rotate: -4deg; } to { rotate: 4deg; } }

/* 开卷有鱼 */
.stand { position: absolute; width: 580px; height: 420px; perspective: 1500px; z-index: 7; }
.stand .leaf { position: absolute; top: 0; width: 290px; height: 420px; background-repeat: no-repeat; background-size: 580px 420px; background-color: rgba(220,210,190,.5); transition: background-color .6s; }
.stand .leaf.in { background-color: transparent; }
.stand .l { left: 0; background-position: 0 0; transform-origin: right center; transform: rotateY(28deg); border-radius: 18px 0 0 18px; }
.stand .r { right: 0; background-position: -290px 0; transform-origin: left center; transform: rotateY(-28deg); border-radius: 0 18px 18px 0; }
.desk { position: absolute; height: 26px; border-radius: 50%; background: radial-gradient(rgba(40,30,20,.28), transparent 70%); z-index: 6; }
.cap { position: absolute; z-index: 7; font: 17px/2 var(--kai); letter-spacing: 5px; color: var(--mid); }
.cap b { display: block; font: 22px/1.6 var(--kai); color: var(--ink); letter-spacing: 6px; font-weight: normal; }
.step { font: 13px/1 var(--latin); letter-spacing: 3px; color: var(--red); }
html[lang="en"] .cap { font: 17px/1.5 var(--latin); letter-spacing: 0; }
html[lang="en"] .cap b { font: italic 22px/1.35 var(--latin); letter-spacing: 0; margin: 4px 0 6px; }

/* 题跋: the scroll's last word, the app's own card, the collector's seals */
.coda-card .appicon { display: block; margin-bottom: 18px; }
.coda-card .nm.qh { font-size: 46px; line-height: 1.1; letter-spacing: .08em; }
.coda-card .nm.sc { font-size: 22px; line-height: 1.3; }
.coda-card .badge { margin-top: 26px; }
.coda-card .fine { margin-top: 10px; }
/* the scroll's end as it is mounted: the paper, a strip of 绫, the roller with jade caps in the silk above and below */
.ling { position: absolute; left: 28px; top: 26px; bottom: 26px; width: 30px; background: repeating-linear-gradient(-45deg, #C7B79A 0 6px, #CDBEA2 6px 12px); box-shadow: inset -1px 0 0 rgba(0,0,0,.12), inset 1px 0 0 rgba(255,255,255,.18); z-index: 8; }
.roller { position: absolute; left: 0; top: 0; bottom: 0; width: 28px; background: linear-gradient(90deg, #2B1C12, #573B26 24%, #8A6445 46%, #61432C 66%, #2B1C12); box-shadow: 3px 0 8px rgba(50,32,16,.26); z-index: 9; }
.roller::before, .roller::after { content: ""; position: absolute; left: 0; width: 33px; height: 30px; background: linear-gradient(90deg, #8E9F8F, #DCE4D6 42%, #B4C3B1 66%, #7F907F); box-shadow: 0 0 0 1px rgba(60,70,55,.22); }
.roller::before { top: 0; border-radius: 0 0 5px 0; } .roller::after { bottom: 0; border-radius: 0 5px 0 0; }
.foot-links { position: absolute; z-index: 7; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em .7em; font-size: 14px; color: var(--mid); letter-spacing: 1px; max-width: 520px; }
html[lang="en"] .foot-links { font-family: var(--latin); font-size: 15px; letter-spacing: .3px; }
.foot-links a { text-decoration: none; border-bottom: 1px solid var(--hair); }
.foot-links span { color: var(--light); }
.foot-links small { flex-basis: 100%; font: 12px/1.6 var(--latin); color: var(--light); letter-spacing: .5px; margin-top: 6px; }

/* ===================================================================================== 手机 · 立轴 */
.zhou { width: 390px; margin: 0 auto; zoom: var(--mz, 1); background: #EFE7D5; overflow: hidden; position: relative; isolation: isolate; }
.zhou::before { content: ""; position: absolute; inset: 0; background: url("img/grain.webp"); background-size: 512px; opacity: .22; mix-blend-mode: multiply; pointer-events: none; z-index: -1; }
.zhou .tian { height: 22px; background: linear-gradient(#C9BCA2, #D8CCB3); }
.zhou .nav { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; font-size: 14px; color: var(--mid); }
.zhou .nav .brand { font-size: 14px; }
.zhou .nav .lang a { text-decoration: none; } .zhou .nav .lang b { font-weight: normal; color: var(--ink); }
.zhou .hero { position: relative; height: 780px; }
.zhou .heroimg { position: absolute; left: 0; top: 0; width: 390px; height: 300px; object-fit: cover; object-position: 8% 50%; -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }
.zhou .sec { position: relative; border-top: 1px solid var(--hair); margin: 0 14px; }
.zhou .t { right: 8px; top: 30px; font-size: 58px; line-height: 1; }
.zhou .q { right: 78px; top: 36px; font-size: 19px; letter-spacing: 6px; line-height: 1.7; color: var(--ink); }
.zhou .b { font-size: 13px; letter-spacing: 4px; line-height: 1.9; color: var(--mid); }
.zhou .no { right: 8px; top: 10px; font-size: 11px; letter-spacing: 2px; }
.zhou .ph { position: absolute; filter: drop-shadow(0 16px 20px rgba(20,25,35,.22)); }
.zhou .strip4 { width: 104px; height: 250px; padding: 6px; top: auto; box-shadow: 0 8px 18px rgba(60,40,20,.12); }
.zhou .strip4::after { display: none; }
.zhou .card { width: 168px; height: 320px; box-shadow: 0 10px 22px rgba(60,40,20,.12); }
.zhou .card .nm { right: 12px; top: 16px; font-size: 30px; }
.zhou .card .ln { right: 54px; top: 20px; font-size: 13px; letter-spacing: 3px; line-height: 1.8; height: 170px; }
.zhou .card .enl { top: 150px; left: 12px; right: 12px; font-size: 13px; }
.zhou .cap { font-size: 13px; line-height: 1.8; letter-spacing: 3px; }
.zhou .cap b { font-size: 16px; letter-spacing: 4px; }
.zhou .step { font-size: 11px; letter-spacing: 2px; }
.zhou .stand { width: 300px; height: 218px; perspective: 900px; }
.zhou .stand .leaf { width: 150px; height: 218px; background-size: 300px 218px; }
.zhou .stand .r { background-position: -150px 0; }
.zhou .moon { width: 300px; height: 300px; box-shadow: 0 0 0 9px #DCCFB4, 0 0 0 10px rgba(33,28,22,.22), 0 16px 30px 8px rgba(60,40,20,.14); }
.zhou .pool { transform: scale(.5); }
.zhou .lead { position: absolute; left: 4px; font-size: 15px; line-height: 1.8; letter-spacing: 2px; color: var(--ink); }
.zhou .en { position: relative; left: auto; right: auto; top: auto; padding: 0 4px; }
.zhou .en .q { font-size: 22px; letter-spacing: 0; line-height: 1.3; } .zhou .en .b { font-size: 15px; letter-spacing: 0; line-height: 1.5; }
.zhou .cta .fine { margin-top: 10px; font-size: 12px; }
.zhou .coda-card { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center; }
.zhou .coda-card .appicon { margin: 0; }
.zhou .coda-card .nm.qh { font-size: 34px; }
.zhou .coda-card .badge, .zhou .coda-card .fine { grid-column: 1 / -1; }
.zhou .coda-card .badge { margin-top: 22px; }
.zhou .foot-links { font-size: 13px; }
html[lang="en"] .zhou .cap { font: 14px/1.5 var(--latin); letter-spacing: 0; }
html[lang="en"] .zhou .cap b { font: italic 17px/1.35 var(--latin); letter-spacing: 0; }

/* ===================================================================================== 声 */
.sheng { position: fixed; right: 22px; bottom: 22px; z-index: 50; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(239,231,213,.92); color: var(--mid); box-shadow: inset 0 0 0 1.5px rgba(33,28,22,.35), 0 6px 18px rgba(40,30,20,.16);
  font: 20px/48px var(--kai); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheng::after { content: ""; position: absolute; left: 11px; right: 11px; top: 50%; height: 1.5px; background: rgba(33,28,22,.45); transform: rotate(-35deg); }
.sheng[aria-pressed="true"] { background: var(--red); color: #F4EADB; box-shadow: 0 6px 18px rgba(120,40,20,.28); }
.sheng[aria-pressed="true"]::after { display: none; }
.sheng-tip { position: fixed; right: 80px; bottom: 34px; z-index: 50; font: 13px/1 var(--kai); color: var(--mid); letter-spacing: 2px; opacity: 0; transition: opacity .6s; pointer-events: none; }
.sheng-tip.show { opacity: 1; }
html[lang="en"] .sheng-tip { font-family: var(--latin); letter-spacing: 0; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .lz { transition: none; }
  .js .crab { transform: none; transition: none; } .js .crab.lz.in { opacity: 1; }
  .js .ripple ellipse { transform: none; opacity: .85; animation: none !important; }
  .fish, .fish img { animation: none !important; }
}

.foot-links .icp, .foot-links .icp:visited { color: inherit; text-decoration: none; }
