/* 活页同学录 v6 — kraft pages with faint hearts, red accents, cream / yellow / grey-blue cards, black text, one font. */
:root {
  --pw: 774px; --ph: 1100px;
  --ink: #1c1b19; --ink2: #3f3a34; --rule: rgba(28,27,25,.32);
  --red: #b3141c; --kraft: #c9a37e; --cream: #f7f0e1; --yellow: #f2e49a; --blue: #bac3c9;
  --font: "Kai", "Kaiti SC", "STKaiti", "KaiTi", serif;
  --tooth: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='l' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.6' numOctaves='3' seed='4' stitchTiles='stitch'/%3E%3CfeDiffuseLighting lighting-color='%23fff' surfaceScale='1.4' diffuseConstant='1.1'%3E%3CfeDistantLight azimuth='225' elevation='58'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23l)'/%3E%3C/svg%3E");
  --hearts: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cg fill='%23e2c4a0' fill-opacity='.55'%3E%3Cpath transform='translate(28 30) scale(1.5) rotate(-14 12 12)' d='M12 21s-7.5-4.6-9.6-9.2C.7 8.3 2.7 4.5 6.4 4.5c2.1 0 3.6 1.2 4.4 2.6.9-1.4 2.4-2.6 4.5-2.6 3.7 0 5.6 3.8 4 7.3C19.2 16.4 12 21 12 21z'/%3E%3Cpath transform='translate(128 122) scale(1.2) rotate(12 12 12)' d='M12 21s-7.5-4.6-9.6-9.2C.7 8.3 2.7 4.5 6.4 4.5c2.1 0 3.6 1.2 4.4 2.6.9-1.4 2.4-2.6 4.5-2.6 3.7 0 5.6 3.8 4 7.3C19.2 16.4 12 21 12 21z'/%3E%3C/g%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #e9e8e4; color: var(--ink); font: 19px/1.6 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
#app { position: relative; min-height: 100vh; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
#measure { position: fixed; left: -5000px; top: 0; visibility: hidden; pointer-events: none; }
.lab { font: 19px/1.5 var(--font); color: var(--ink); }
.mono { font: 18px var(--font); color: var(--ink2); }

/* ============ paper ============ */
.page { position: relative; width: var(--pw); height: var(--ph); overflow: hidden; border-radius: 4px; background-color: var(--kraft); color: var(--ink); }
.page::after { content: ""; position: absolute; inset: 0; background: var(--tooth); opacity: .16; mix-blend-mode: multiply; pointer-events: none; z-index: 200; }
.paper-kraft, .page-empty { background-color: var(--kraft); background-image: var(--hearts); background-size: 200px 200px; }
.pgno { position: absolute; bottom: 20px; font: 17px var(--font); color: var(--ink2); opacity: .7; z-index: 150; }
.side-l .pgno { left: 40px; } .side-r .pgno, .side-s .pgno { right: 40px; }

.card { background: var(--c, var(--cream)); border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 16px 24px -16px rgba(0,0,0,.45); }
.card::after { content: ""; position: absolute; inset: 0; background: var(--tooth); opacity: .12; mix-blend-mode: multiply; border-radius: inherit; }
.card-cream { --c: var(--cream); } .card-yellow { --c: var(--yellow); } .card-blue { --c: var(--blue); }
.polka { position: absolute; z-index: 1; background-color: #f7efcf; background-image: radial-gradient(circle, #bf171f 0 8px, transparent 8.6px); background-size: 44px 44px; background-position: 6px 6px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }

/* ============ the open book ============ */
.book-root { position: relative; margin: 0 auto; width: var(--stage-w); height: calc(var(--stage-h) + 64px); user-select: none; -webkit-user-select: none; touch-action: pan-y; --cv: #9e1d26; --thread: #f1e8d5; }
.book-root[data-cover=kraft] { --cv: #a8825c; --thread: #b3141c; } .book-root[data-cover=cream] { --cv: #e3d6bf; --thread: #b3141c; }
.book-root[data-cover=blue] { --cv: #98a4ac; --thread: #f6f1e6; } .book-root[data-cover=black] { --cv: #1d1c1e; --thread: #b3141c; }
.book-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; perspective: 3000px; }
.binder-back { position: absolute; inset: -15px -17px; border-radius: 12px; background: var(--cv); box-shadow: 0 46px 60px -38px rgba(0,0,0,.5), 0 16px 24px -16px rgba(0,0,0,.35), 0 2px 3px rgba(0,0,0,.3); }
.binder-back::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(0deg, rgba(255,255,255,.08) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 1px, transparent 1px 3px); }
.slot { position: absolute; top: 0; width: var(--pw); height: var(--ph); }
.slot .page, .face .page { box-shadow: 0 1px 2px rgba(0,0,0,.28); }
.is-spread .slot-l { left: 0; box-shadow: -2px 0 0 #e5dccb, -4px 1px 0 #f3eee3, -6px 1px 0 #ddd3c0, -7px 2px 3px rgba(0,0,0,.3); }
.is-spread .slot-r { left: calc(var(--pw) + 6px); box-shadow: 2px 0 0 #e5dccb, 4px 1px 0 #f3eee3, 6px 1px 0 #ddd3c0, 7px 2px 3px rgba(0,0,0,.3); }
.is-single .slot-l { left: 18px; box-shadow: 2px 0 0 #e5dccb, 4px 1px 0 #f3eee3, 6px 1px 0 #ddd3c0, 7px 2px 3px rgba(0,0,0,.3); }
.is-single .slot-r { display: none; }
.rings { position: absolute; top: 0; height: var(--ph); width: 10px; z-index: 300; pointer-events: none; }
.is-spread .rings { left: calc(var(--pw) - 2px); } .is-single .rings { left: 13px; }
.rings i { position: absolute; left: 3px; width: 4px; border-radius: 2px; background: var(--thread); box-shadow: 0 1px 1.5px rgba(0,0,0,.45); }
.is-spread .slot-l .page::before, .is-spread .face .side-l::before { content: ""; position: absolute; inset: 0 0 0 auto; width: 110px; background: linear-gradient(to left, rgba(0,0,0,.2), rgba(0,0,0,.06) 26%, transparent); z-index: 190; pointer-events: none; }
.is-spread .slot-r .page::before, .is-spread .face .side-r::before, .is-single .page::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 110px; background: linear-gradient(to right, rgba(0,0,0,.2), rgba(0,0,0,.06) 26%, transparent); z-index: 190; pointer-events: none; }
.flipper { position: absolute; top: 0; width: var(--pw); height: var(--ph); transform-style: preserve-3d; z-index: 250; }
.is-spread .flip-r { left: calc(var(--pw) + 6px); transform-origin: -3px center !important; }
.is-spread .flip-l { left: 0; transform-origin: calc(var(--pw) + 3px) center !important; }
.is-single .flip-s { left: 18px; transform-origin: -2px center !important; }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); }
.shade { position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,.45), rgba(0,0,0,.04)); opacity: 0; pointer-events: none; z-index: 260; }
.book-nav { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; display: flex; align-items: center; justify-content: center; gap: 20px; }
.nav-btn { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--ink); background: #fffdf7; font: 24px/1 var(--font); display: grid; place-items: center; }
.nav-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }
.nav-btn:disabled { opacity: .25; pointer-events: none; }
.nav-pos { font: 19px var(--font); min-width: 84px; text-align: center; color: var(--ink2); }

/* ============ photo page ============ */
.photo { margin: 0; background: #fcfbf7; box-shadow: 0 1px 1px rgba(0,0,0,.18), 0 14px 20px -14px rgba(0,0,0,.55); cursor: zoom-in; }
.photo img { display: block; object-fit: cover; background: #d9d6ce; }
.tone-film .photo img, .tone-film .env-photo img { filter: saturate(.85) contrast(.95) brightness(1.04) sepia(.12); }
.tone-bw .photo img, .tone-bw .env-photo img { filter: grayscale(1) contrast(1.05); }
.frame-print { padding: 12px; }
.frame-print figcaption { position: absolute; left: 10px; right: 10px; bottom: 8px; height: 36px; text-align: center; font: 22px/36px var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame-instax { border-radius: 4px; background: linear-gradient(135deg, #fffefb, #f6f3ec); }
.frame-instax img { border-radius: 1.5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.frame-instax figcaption { font-family: var(--font); color: var(--ink); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.nametag { display: flex; flex-direction: column; padding: 8px 9px 10px; background: var(--red); border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.25), 0 12px 18px -12px rgba(0,0,0,.5); }
.nt-top { color: #fff; font: 18px/1 var(--font); text-align: center; padding: 6px 0 9px; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-name { flex: 1; background: #fffdf8; border-radius: 6px; display: grid; place-items: center; color: var(--ink); font-family: var(--font); line-height: 1.1; padding: 0 10px; white-space: nowrap; overflow: hidden; }
.booth { background: #f5f2ea; padding: 13px 14px 34px; box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 14px 20px -14px rgba(0,0,0,.5); }
.booth-frame { height: calc(var(--fh) - 10px); margin: 0 0 10px; overflow: hidden; cursor: zoom-in; background: #222; }
.booth-frame img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1) sepia(.2) contrast(1.06); }
.sticky { width: 168px; padding: 18px 14px 14px; color: var(--ink); background: linear-gradient(to bottom, rgba(0,0,0,.05), transparent 18px), var(--yellow); box-shadow: 0 1px 1px rgba(0,0,0,.12), 3px 14px 14px -10px rgba(0,0,0,.42); }
.sticky small { display: block; font: 17px/1.3 var(--font); color: var(--ink2); margin-bottom: 8px; }
.sticky p { margin: 0; font: 30px/1.15 var(--font); overflow-wrap: anywhere; }
img.sticker, img.lace, img.doily, img.clip { height: auto; pointer-events: none; }
img.sticker { filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
img.gem { filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
img.lace { filter: drop-shadow(0 1px 1px rgba(0,0,0,.18)); }
img.doily { filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
img.clip { filter: drop-shadow(1px 3px 2px rgba(0,0,0,.35)); }
.owed { position: absolute; display: grid; place-items: center; }
.owed .ink { position: absolute; inset: 0; width: 100%; height: 100%; }
.ink path { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.red-loop path { fill: none; stroke: var(--red); stroke-width: 2.2; stroke-linecap: round; }
.owed p { margin: 0; font: 26px/1.6 var(--font); color: var(--ink); text-align: center; white-space: pre-line; }
.pgroup { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; z-index: 12; }
.pgroup > * { pointer-events: none; }
.pgroup .photo { pointer-events: auto; cursor: grab; touch-action: none; }
.pgroup.dragging .photo { cursor: grabbing; }
.pgroup.dragging { filter: drop-shadow(0 14px 14px rgba(0,0,0,.22)); }
.tape { filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); opacity: .95; }
.tape i { position: absolute; top: 0; bottom: 0; width: 50.5%; background-repeat: no-repeat; background-size: auto 100%; }
.tape .l { left: 0; background-position: left center; } .tape .r { right: 0; background-position: right center; }

/* ============ written pages ============ */
.w-inner { position: absolute; left: 64px; right: 64px; top: 64px; bottom: 70px; overflow: hidden; z-index: 10; }
.w-inner { pointer-events: none; } .w-inner > * { pointer-events: auto; }
.w-inner.on-card { left: 96px; right: 96px; top: 108px; bottom: 96px; }
.w-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--red); padding-bottom: 8px; margin-bottom: 26px; }
.w-head h3 { font: 44px/1.2 var(--font); margin: 0; color: var(--ink); }
.w-head span { font: 20px var(--font); color: var(--ink2); }
.fld { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; min-width: 0; }
.fld-l { font: 18px/1.4 var(--font); color: var(--ink2); white-space: nowrap; }
.fld-v { flex: 1; min-width: 0; min-height: 40px; font: 26px/1.5 var(--font); color: var(--ink); border-bottom: 1.5px dotted var(--rule); padding: 0 4px 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fld-name { margin-bottom: 22px; }
.fld-name .fld-v { font-size: 48px; line-height: 1.3; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 26px; }
.fgrid .fld.wide { grid-column: 1 / -1; }
.fgrid .fld-v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.about { margin-top: 22px; }
.about .ans { font: 25px/1.75 var(--font); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; }
.note { position: relative; padding: 16px 22px 14px; margin: 0 6px 24px; background-color: var(--n, var(--cream)); box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 12px 16px -14px rgba(0,0,0,.45); }
.note-yellow { --n: var(--yellow); background-image: repeating-linear-gradient(to bottom, transparent 0 39px, rgba(70,105,150,.26) 39px 40px); background-position: 0 48px; }
.note-cream { --n: var(--cream); } .note-blue { --n: #c7ced3; }
.note-q { font: 18px/1.5 var(--font); color: var(--ink2); margin-bottom: 4px; }
.note .ans { font: 25px/40px var(--font); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.chips-note { margin: 0 6px 24px; }
.chips { display: flex; gap: 10px 14px; flex-wrap: wrap; padding: 4px 0; }
.chip { position: relative; font: 28px/56px var(--font); color: var(--ink); padding: 0 24px; }
.chip svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* letter page: an open red envelope */
.lp-head { position: absolute; left: 64px; right: 64px; top: 64px; display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--red); padding-bottom: 8px; z-index: 5; }
.lp-head h3 { font: 44px/1.2 var(--font); margin: 0; }
.lp-head span { font: 19px var(--font); color: var(--ink2); }
.envelope { position: absolute; left: 107px; top: 330px; width: 560px; height: 640px; z-index: 6; }
.envelope::after { content: ""; position: absolute; left: 14px; right: 14px; top: 618px; height: 34px; background: radial-gradient(ellipse at center, rgba(0,0,0,.3), transparent 70%); z-index: 0; }
.env-back, .env-flap, .env-pocket { position: absolute; left: 0; right: 0; background-color: #a51b24; background-size: 560px auto; background-position: center; }
.env-back { top: 280px; height: 360px; filter: brightness(.7); border-radius: 3px; z-index: 1; }
.env-flap { top: 78px; height: 204px; clip-path: polygon(0 100%, 50% 0, 100% 100%); filter: brightness(.82); z-index: 1; }
.env-photo { position: absolute; left: 292px; top: 150px; width: 236px; margin: 0; padding: 9px; background: #fcfbf7; transform: rotate(9deg); box-shadow: 0 10px 14px -10px rgba(0,0,0,.5); z-index: 2; }
.env-photo img { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; }
.env-letter { position: absolute; left: 38px; top: 36px; width: 420px; height: 560px; padding: 32px 32px 0; background-color: #fffdf7; background-image: repeating-linear-gradient(to bottom, transparent 0 37px, rgba(179,20,28,.18) 37px 38px); background-position: 0 70px; transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 12px 18px -12px rgba(0,0,0,.45); cursor: pointer; z-index: 3; transition: transform .65s cubic-bezier(.3,.1,.2,1); overflow: hidden; }
.env-letter:hover { transform: translateY(-16px) rotate(-3deg); }
.envelope.out .env-letter { transform: translateY(-150px) rotate(0deg); }
.el-to { margin: 0 0 10px; font: 25px/38px var(--font); }
.el-body { margin: 0; font: 22px/38px var(--font); color: var(--ink); white-space: pre-wrap; max-height: 190px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.el-sign { display: none; }
.env-pocket { top: 280px; height: 360px; clip-path: polygon(0 0, 50% 44%, 100% 0, 100% 100%, 0 100%); z-index: 4; }
.env-pocket::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255,255,255,.1), rgba(0,0,0,.14)); }
.env-pocket::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top right, transparent calc(50% - 1px), rgba(0,0,0,.22) 50%, rgba(255,255,255,.12) calc(50% + 1px), transparent calc(50% + 2.5px)) left bottom / 50% 56% no-repeat, linear-gradient(to top left, transparent calc(50% - 1px), rgba(0,0,0,.22) 50%, rgba(255,255,255,.12) calc(50% + 1px), transparent calc(50% + 2.5px)) right bottom / 50% 56% no-repeat; }
.env-gem { position: absolute; width: 34px; z-index: 5; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); pointer-events: none; }
.env-gem.g1 { left: 130px; top: 480px; transform: rotate(-12deg); } .env-gem.g2 { left: 392px; top: 530px; transform: rotate(14deg); }
.reader { position: fixed; inset: 0; z-index: 900; background: rgba(48,32,22,.55); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity .3s; }
.reader.on { opacity: 1; }
.reader-card { width: min(640px, 100%); max-height: 90vh; overflow: auto; padding: 44px 44px 30px; background-color: #fffdf7; background-image: repeating-linear-gradient(to bottom, transparent 0 41px, rgba(179,20,28,.16) 41px 42px); background-position: 0 86px; box-shadow: 0 24px 50px -20px rgba(0,0,0,.6); transform: translateY(18px); transition: transform .3s; }
.reader.on .reader-card { transform: none; }
.rd-to { margin: 0 0 14px; font: 28px/42px var(--font); }
.rd-body { margin: 0; font: 25px/42px var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
.rd-sign { margin: 22px 0 26px; text-align: right; font: 26px/42px var(--font); }

/* contents, quiet pages, invitation */
.toc-sub { font: 26px/1.5 var(--font); color: var(--ink); margin: -6px 0 18px; }
.toc-row { display: flex; align-items: baseline; gap: 14px; height: 60px; text-decoration: none; padding-top: 12px; color: var(--ink); }
.toc-row.is-hidden { opacity: .4; }
.toc-no { font: 20px var(--font); color: var(--red); width: 34px; }
.toc-name { font: 34px/1 var(--font); }
.toc-row:hover .toc-name { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 7px; }
.toc-dots { flex: 1; border-bottom: 2px dotted var(--rule); margin-bottom: 6px; }
.toc-pg { font: 20px var(--font); color: var(--ink2); }
.toc-empty, .blank-note { font: 25px/1.6 var(--font); color: var(--ink); margin: 0; }
.blank-note { margin-top: 400px; text-align: center; }
.cta-page { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 26px; padding-top: 220px; }
.cta-page .cta-t { font: 80px/1.1 var(--font); }
.cta-page p { margin: 0; font: 25px/1.9 var(--font); max-width: 17em; }
.cta-page .btn { font-size: 26px; padding: 16px 44px; margin-top: 10px; }

/* ============ app chrome ============ */
.topbar { position: sticky; top: 0; z-index: 400; display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: rgba(233,232,228,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar .brand { font: 28px/1 var(--font); margin-right: auto; text-decoration: none; }
.tabs { display: flex; gap: 22px; flex-wrap: wrap; }
.tab { font: 20px/1 var(--font); text-decoration: none; padding: 6px 2px; color: var(--ink2); border-bottom: 2px solid transparent; }
.tab.on { color: var(--ink); border-color: var(--red); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 26px; border: 2px solid var(--red); border-radius: 999px; background: #fffdf7; color: var(--ink); font: 20px/1.3 var(--font); text-decoration: none; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.btn:hover { background: #fff3e8; }
.btn.ghost { border-color: rgba(28,27,25,.45); background: transparent; }
.btn.small { padding: 6px 18px; font-size: 17px; }
.btn:disabled { opacity: .45; }
.view { padding: 8px 12px 60px; }
.center { max-width: 600px; margin: 0 auto; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #fffdf7; color: var(--ink); border: 2px solid var(--red); border-radius: 999px; padding: 9px 22px; font-size: 18px; opacity: 0; transition: .3s; z-index: 999; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.lightbox { position: fixed; inset: 0; z-index: 900; background: rgba(18,18,18,.93); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 82vh; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.lightbox p { color: #eee; font: 24px var(--font); }
.loading { padding: 90px 20px; text-align: center; font: 26px var(--font); color: var(--ink2); }
.under-book, .entry-tools, .preview-tools { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.preview-tools { margin: 4px 0 20px; }
.done-title { font: 40px/1.4 var(--font); margin: 6px 0 2px; }
.cover-hint { font: 20px/1.7 var(--font); color: var(--ink2); text-align: center; margin: 0 0 12px; }

/* closed notebook: a photograph with a name tag on it */
.cover-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 12px 50px; }
.cover { position: relative; width: min(92vw, 470px, 62vh); aspect-ratio: 2 / 3; cursor: pointer; }
.cover > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent); mask-composite: intersect; }
.cover .cv-wrap { position: absolute; left: var(--lx, 27%); top: var(--ly, 54%); width: var(--lw, 46%); transform: rotate(var(--lr, -2deg)); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cover .cv-wrap .nametag { width: 100%; }
.cover .cv-count { background: #fffdf7; padding: 3px 12px; font: clamp(12px, 3.3vw, 15px)/1.5 var(--font); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.25); transform: rotate(2deg); }
.cover .nametag .nt-top { font-size: clamp(12px, 3.4vw, 16px); }
.cover .nametag .nt-name { padding: 12px 10px; white-space: normal; text-align: center; font-size: clamp(22px, 6.4vw, 32px) !important; }
.cover-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 10px; }
.cover-pick button { position: relative; border: 0; padding: 0; background: #efe7da; aspect-ratio: 2 / 3; overflow: hidden; outline: 1px solid rgba(0,0,0,.12); outline-offset: 2px; border-radius: 3px; }
.cover-pick button.on { outline: 2.5px solid var(--red); }
.cover-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* landing */
.hero { max-width: 1040px; margin: 0 auto; padding: 30px 26px 10px; display: grid; gap: 18px; }
.hero-title { margin: 0; font: clamp(72px, 15vw, 128px)/1.05 var(--font); }
.hero-title em { display: block; font: normal clamp(20px, 3vw, 26px)/1.4 var(--font); color: var(--ink2); margin-top: 8px; }
.hero p.lede { font: 23px/1.9 var(--font); margin: 0; max-width: 28em; }
.steps { max-width: 1040px; margin: 26px auto 30px; padding: 0 26px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 26px; }
.step { position: relative; background: var(--cream); padding: 22px 18px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 12px 16px -14px rgba(0,0,0,.4); transform: rotate(var(--rt, -.8deg)); }
.step:nth-child(2) { --rt: .7deg; background: var(--yellow); } .step:nth-child(3) { --rt: -.3deg; background: #c7ced3; }
.step i { font: normal 22px/1 var(--font); color: var(--red); }
.step b { display: block; font: 400 32px/1.3 var(--font); margin: 2px 0; }
.step p { margin: 0; font: 19px/1.7 var(--font); }
.sample { margin: 30px auto 50px; }

/* ============ forms ============ */
.sheet { position: relative; max-width: 600px; margin: 0 auto; background: #fffaf0; padding: 30px 30px 32px; border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 26px 36px -26px rgba(0,0,0,.45); }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; border-bottom: 2px solid var(--red); padding-bottom: 6px; }
.sheet-head h2 { font: 38px/1.3 var(--font); margin: 0; }
.sheet-head .mono { white-space: nowrap; }
.sheet .intro { font: 20px/1.7 var(--font); color: var(--ink2); margin: 0 0 20px; }
.field { margin: 0 0 22px; }
.field > label { display: flex; align-items: baseline; gap: 10px; margin-bottom: 2px; flex-wrap: wrap; }
.field .req { font: 16px var(--font); color: var(--red); }
.field .hint { font: 16px/1.5 var(--font); color: #7d756b; }
.field input[type=text], .field textarea { width: 100%; border: 0; border-bottom: 1.5px solid var(--rule); background: transparent; font: 25px/1.6 var(--font); color: var(--ink); padding: 4px 4px 2px; outline: none; border-radius: 0; }
.field textarea { resize: vertical; min-height: 120px; line-height: 40px; padding: 0 4px; border-bottom: 0; background-image: repeating-linear-gradient(to bottom, transparent 0 38.5px, var(--rule) 38.5px 40px); background-attachment: local; }
.field input:focus { border-color: var(--red); }
.field input::placeholder, .field textarea::placeholder { color: #bdb6aa; }
.field .count { text-align: right; font: 15px var(--font); color: #a9a59c; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } .sheet { padding: 24px 18px 28px; } .cover-pick { grid-template-columns: repeat(3, 1fr); } }
.sheet-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.progress { display: flex; gap: 8px; justify-content: center; margin: 6px auto 18px; }
.progress i { width: 26px; height: 3px; border-radius: 2px; background: rgba(0,0,0,.16); }
.progress i.on { background: var(--red); }
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px; margin-top: 12px; }
.ph-card { background: #fcfbf7; padding: 9px 9px 6px; box-shadow: 0 1px 1px rgba(0,0,0,.16), 0 10px 16px -12px rgba(0,0,0,.45); position: relative; }
.ph-card:nth-child(odd) { transform: rotate(-1.4deg); } .ph-card:nth-child(even) { transform: rotate(1.2deg); }
.ph-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #e6e3db; }
.ph-card input { width: 100%; border: 0; font: 20px var(--font); color: var(--ink); padding: 6px 2px 2px; outline: none; background: transparent; text-align: center; }
.ph-card .rm { position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font: 15px/1 sans-serif; }
.ph-card .busy { position: absolute; inset: 9px 9px auto; aspect-ratio: 1; display: grid; place-items: center; background: rgba(255,255,255,.72); font-size: 17px; }
.ph-add { border: 1.5px dashed var(--ink2); aspect-ratio: .82; display: grid; place-items: center; text-align: center; font: 19px/1.7 var(--font); color: var(--ink2); background: transparent; white-space: pre-line; }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.pp { width: 56px; height: 76px; border: 0; border-radius: 2px; outline: 1px solid rgba(0,0,0,.15); outline-offset: 3px; font-size: 14px; color: var(--ink); display: grid; place-items: end center; padding-bottom: 4px; }
.pp.on { outline: 2px solid var(--red); }
.seg { display: inline-flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.seg button { border: 1.5px solid rgba(28,27,25,.4); background: transparent; padding: 5px 18px; font-size: 18px; border-radius: 999px; }
.seg button.on { border-color: var(--red); background: #fff3e8; }
.q-list { display: grid; }
.q-item { display: flex; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1.5px solid var(--rule); }
.q-item input[type=checkbox] { width: 18px; height: 18px; accent-color: #b3141c; flex: none; }
.q-item input[type=text] { flex: 1; border: 0; background: transparent; font: 22px var(--font); color: var(--ink); outline: none; min-width: 0; }
.linkbox { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1.5px solid var(--rule); word-break: break-all; font: 19px/1.6 var(--font); }
.linkbox span { flex: 1; }
.warn { padding: 12px 0 0; font: 18px/1.7 var(--font); color: #8a2a1e; }
.err { color: var(--red); font-size: 18px; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) { .env-letter, .reader, .reader-card { transition: none; } .pgroup.dragging { filter: none; } }

/* ============ v7: clean pages, the original black cover ============ */
.page, .paper-kraft, .page-empty { background-color: #f6f2ea; background-image: none; }
.page::after { opacity: .08; }
.book-root { --cv: #1d1d1f; --thread: #b3141c; }
.binder-back::before { background: var(--tooth); opacity: .4; mix-blend-mode: soft-light; }
.p-head { position: absolute; left: 64px; right: 64px; top: 70px; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 2px solid var(--red); padding-bottom: 12px; }
.p-head h2 { margin: 0; font: 54px/1.15 var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-head span { font: 20px var(--font); color: var(--ink2); white-space: nowrap; }
.photo.movable { cursor: grab; touch-action: none; }
.photo.dragging { cursor: grabbing; box-shadow: 0 1px 1px rgba(0,0,0,.18), 0 24px 30px -16px rgba(0,0,0,.5); }
.booth { background: #fcfbf7; }
.owed { border: 2px dashed rgba(28,27,25,.3); border-radius: 4px; }
.sticky { width: 168px; height: 168px; }
.note { margin: 0 0 22px; padding: 0 0 14px; background: none; box-shadow: none; border-bottom: 1.5px dotted var(--rule); transform: none; }
.note-q { font: 19px/1.5 var(--font); color: var(--ink2); margin-bottom: 4px; }
.note .ans { font: 25px/1.7 var(--font); }
.chips-note { margin: 0 0 22px; padding-bottom: 14px; border-bottom: 1.5px dotted var(--rule); }
.chip { padding: 0 18px; line-height: 46px; border: 1.5px solid var(--red); border-radius: 999px; font-size: 25px; }
.lp-head { z-index: 7; background: #f6f2ea; }
.cover > img { mix-blend-mode: normal; }
.cover .cv-wrap { left: 22%; top: 62%; width: 50%; gap: 6px; transform: rotate(-2deg); }
.cover .cv-label { width: 100%; padding: 14px 12px 12px; background: #f7f3ea; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 14px -10px rgba(0,0,0,.6); border-radius: 2px; }
.cover .cv-label b { display: block; font: clamp(22px, 6vw, 32px)/1.2 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.cover .cv-label span { display: block; margin-top: 4px; font: clamp(12px, 3.3vw, 15px)/1.5 var(--font); color: var(--ink2); }
.cover .cv-label em { display: block; margin-top: 2px; font: normal clamp(12px, 3.3vw, 15px)/1.5 var(--font); color: var(--red); }
.cover .cv-label small { display: block; font: clamp(12px, 3.3vw, 15px)/1.4 var(--font); color: var(--ink2); letter-spacing: .3em; }
.cover .cv-label b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ v8: fresh collage pages, black board with 同学录, gentler page turn ============ */
:root { --ink: #2c2b29; --ink2: #6d6a64; --rule: rgba(110,128,150,.28); --sky: #9fb7cc; }
body { color: var(--ink); }
.page, .page-empty { background-color: #fbfaf6; background-image: radial-gradient(circle, rgba(120,140,160,.22) 1px, transparent 1.4px); background-size: 24px 24px; background-position: 12px 12px; }
.page::after { opacity: .06; }
.book-stage { perspective: 6000px; }
.binder-back { inset: -15px -17px -74px; }
.binder-back::after { content: "同学录"; position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font: 30px/1 var(--font); letter-spacing: .6em; text-indent: .6em; color: rgba(0,0,0,.55); text-shadow: 0 1px 0 rgba(255,255,255,.14), 0 -1px 0 rgba(0,0,0,.6); }
.book-root { height: calc(var(--stage-h) + 100px); }
.book-nav { bottom: -6px; }

.p-head { left: 64px; right: 64px; top: 62px; border-bottom: 0; align-items: center; padding: 0; }
.p-head h2 { position: relative; z-index: 0; padding: 4px 22px; font-size: 46px; overflow: visible; }
.p-head .p-meta { font-size: 18px; color: var(--ink2); }
.tape.under { position: absolute; left: 0; right: 0; top: 4%; height: 92%; width: 100%; z-index: -1; opacity: .85; transform: rotate(-1deg); }
.tape.under i { width: 50.5%; }
.vellum { background: linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,.45)); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
img.scrap { height: auto; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.14)); }
img.clip { height: auto; pointer-events: none; filter: drop-shadow(1px 3px 2px rgba(0,0,0,.3)); }
.frame-instax { border-radius: 4px; background: linear-gradient(135deg, #fffefb, #f6f3ec); padding: 0; }
.frame-instax figcaption { color: var(--ink); }
.photo { box-shadow: 0 1px 1px rgba(0,0,0,.12), 0 12px 18px -14px rgba(0,0,0,.4); }
.sticky { background: linear-gradient(to bottom, rgba(0,0,0,.04), transparent 18px), #f7efc1; }
.booth { background: #fff; }
.owed { border-color: var(--sky); }
.owed p { color: var(--ink2); }

.w-head { border-bottom: 0; margin-bottom: 30px; padding-bottom: 0; }
.w-head h3 { font-size: 40px; }
.w-sub { font: 26px/1.4 var(--font); color: var(--ink); margin: 6px 0 18px; padding-left: 14px; border-left: 4px solid var(--sky); }
.idcard { position: relative; margin: 6px 4px 34px; padding: 30px 34px 22px 58px; background-color: #fffefb; background-image: linear-gradient(to right, transparent 40px, rgba(226,150,160,.6) 40px 41.5px, transparent 41.5px), repeating-linear-gradient(to bottom, transparent 0 41px, rgba(130,165,200,.32) 41px 42px); background-position: 0 0, 0 18px; box-shadow: 0 1px 2px rgba(0,0,0,.14), 0 14px 20px -16px rgba(0,0,0,.4); transform: rotate(-.6deg); }
.idcard .fld-v { border-bottom: 0; }
.idcard .fld-name .fld-v { font-size: 40px; }
.card-tape { position: absolute; top: -12px; width: 104px; height: 28px; }
.card-tape.l { left: 18px; transform: rotate(-8deg); } .card-tape.r { right: 18px; transform: rotate(7deg); }
.note { position: relative; margin: 14px 8px 30px; padding: 22px 24px 16px; border-bottom: 0; box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 12px 16px -14px rgba(0,0,0,.38); }
.note-grid { background-color: #fffefb; background-image: linear-gradient(to right, rgba(130,165,200,.2) 1px, transparent 1px), linear-gradient(to bottom, rgba(130,165,200,.2) 1px, transparent 1px); background-size: 18px 18px; }
.note-lined { background-color: #fcf8ee; background-image: repeating-linear-gradient(to bottom, transparent 0 41px, rgba(130,165,200,.3) 41px 42px); background-position: 0 30px; }
.note-blue { background-color: #e6eef4; }
.note-tape { position: absolute; top: -13px; width: 96px; height: 26px; }
.note-q { font-size: 17px; }
.note .ans { font-size: 24px; line-height: 42px; }
.chip { border: 1.5px solid var(--sky); background: rgba(255,255,255,.6); }
.lp-head { border-bottom: 0; background: none; }
.lp-head h3 { font-size: 40px; }
.toc-no { color: var(--sky); }

/* cover: just the notebook, with 同学录 pressed into the board under it */
.cover-wrap { padding-top: 20px; }
.cover .cv-base { position: absolute; left: 0; right: 0; bottom: -1%; text-align: center; font: clamp(22px, 6vw, 34px)/1 var(--font); letter-spacing: .6em; text-indent: .6em; color: rgba(70,66,60,.55); text-shadow: 0 1px 0 rgba(255,255,255,.75), 0 -1px 0 rgba(0,0,0,.12); pointer-events: none; }
.cover-info { text-align: center; font: 18px/1.7 var(--font); color: var(--ink2); margin: 0; }
.topbar:empty { display: none; }
.topbar .tabs { margin-left: auto; }
body { background: #dedcd7; }
.topbar { background: rgba(222,220,215,.9); }
.p-head h2 span { font: inherit; color: var(--ink); white-space: nowrap; }
.note { margin: 12px 8px 20px; padding: 18px 22px 12px; }
.note .ans { line-height: 38px; }
.note-lined { background-position: 0 26px; background-image: repeating-linear-gradient(to bottom, transparent 0 37px, rgba(130,165,200,.3) 37px 38px); }
.idcard { margin-bottom: 24px; padding-top: 26px; padding-bottom: 16px; }
.idcard .fld { margin-bottom: 10px; }
.w-head { margin-bottom: 22px; }

/* v9: no paper pieces or tape on the written pages: plain text with light dividers */
.idcard { margin: 0 0 26px; padding: 0; background: none; box-shadow: none; transform: none; }
.idcard .fld { border-bottom: 1.5px dotted var(--rule); padding-bottom: 6px; margin-bottom: 12px; }
.idcard .fgrid .fld { margin-bottom: 12px; }
.note { margin: 0 0 18px; padding: 0 0 14px; background: none; box-shadow: none; transform: none; border-bottom: 1.5px dotted var(--rule); }
.p-head h2 { padding: 0; }
/* v11: flat matte stickers; word stickers printed on colour blocks with a white die-cut edge */
img.sticker { filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.22)); }
.tsticker { white-space: nowrap; text-align: center; font-family: var(--font); font-weight: 700; -webkit-text-stroke: .5px currentColor; letter-spacing: .06em; box-shadow: 0 0 0 3px #fbfaf7, 0 2px 3px 2px rgba(0,0,0,.14); pointer-events: none; }

.demo-nav{max-width:720px;margin:10px auto 40px;padding:0 16px;display:flex;flex-wrap:wrap;justify-content:center;gap:8px 22px;font:18px/1.6 var(--font);color:#6d675e}.demo-nav b{font-weight:400;width:100%;text-align:center;font-size:16px;color:#948d82}.demo-nav a{color:#22201d;text-decoration:none;border-bottom:2px solid #f2e0a0;padding:0 2px}
