/* 何小晴人物笔记页：纸张与贴纸使用奶油、粉色、蜂蜜金和可可棕配色。 */
:root { color-scheme: light; --ink: #593b32; --muted: #8d7166; --pink: #d88995; --paper: #fffdf7; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; color: var(--ink); background: #fcf4eb; background-image: radial-gradient(circle, #d9bfb0 1.25px, transparent 1.45px); background-size: 20px 20px; font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 15px; line-height: 1.9; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid var(--pink); outline-offset: 5px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 10; padding: 8px 16px; background: var(--paper); }
.skip-link:focus { top: 12px; }
.topbar { max-width: 1160px; margin: auto; padding: 25px 32px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; }
.brand { font-family: Georgia, serif; font-size: 20px; font-weight: bold; }
.brand span, .back { font-family: 'PingFang SC', sans-serif; font-size: 12px; font-weight: normal; color: var(--muted); }
.back { justify-self: start; border-bottom: 1px solid #bea18e; }
/* 书脊与侧边页签只作装饰，不进入朗读顺序。 */
.notebook { position: relative; max-width: 1100px; margin: 14px auto 70px; background: var(--paper) url("https://app-home-1300605857.cos.ap-guangzhou.myqcloud.com/index/paper-grain.svg") repeat; border: 1px solid #e8d9c7; border-radius: 6px 22px 22px 6px; box-shadow: 5px 6px 0 #eadbca, 9px 11px 0 #f7ecdd, 0 20px 65px #754c3420; }
.binding { position: absolute; left: 22px; top: 30px; bottom: 30px; width: 18px; background: radial-gradient(circle 7px at 9px 19px, #aa8c71 0 4px, #d0b9a0 4.5px 5.5px, #f1e6d8 6px 7px, transparent 7.5px) center top / 18px 38px repeat-y; border-right: 1px solid #eedbd5; }
.book-tab { position: absolute; right: -29px; top: 110px; background: #e9b4bb; writing-mode: vertical-rl; padding: 18px 7px; border-radius: 0 7px 7px 0; font-size: 12px; letter-spacing: 3px; }
.page-content { padding: 35px 55px 28px 75px; }
.page-heading { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; letter-spacing: 2px; color: #a58776; border-bottom: 1px solid #e9d9c8; padding-bottom: 13px; }
.cover { display: grid; grid-template-columns: 1fr 1fr; align-items: center; min-height: 610px; gap: 10px; }
.eyebrow { color: #a96c74; font-size: 12px; letter-spacing: 2px; }
.eyebrow span { font-size: 21px; margin-right: 8px; }
h1 { font-family: 'Songti SC', 'STSong', serif; font-size: clamp(52px, 6vw, 76px); line-height: 1.25; letter-spacing: 6px; margin: 14px 0 22px; }
h1 span { display: block; font-family: Georgia, serif; font-size: 20px; font-style: italic; letter-spacing: 1px; color: #b89075; margin-top: 10px; }
.intro { font-size: 15px; }
.name-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.name-tags span { padding: 2px 11px; border: 1px solid #e9d9c8; border-radius: 20px; font-size: 11px; color: #8e6b54; }
blockquote { margin: 28px 0 23px; font-family: 'Kaiti SC', STKaiti, KaiTi, serif; font-size: 32px; line-height: 1.55; transform: rotate(-3deg); }
blockquote span { background: linear-gradient(transparent 66%, #f4dfb0 66%, #f4dfb0 90%, transparent 90%); }
.read-on { display: inline-block; font-size: 12px; border-bottom: 1px dashed #c69799; padding-bottom: 3px; }
.portrait { position: relative; isolation: isolate; text-align: center; padding: 25px 8px 16px; }
.portrait img { position: relative; width: 100%; max-height: 510px; object-fit: contain; filter: drop-shadow(0 12px 8px #754c3419); }
.portrait-halo { position: absolute; z-index: -1; inset: 17% 0 12%; border-radius: 48% 52% 45% 55%; background: #fbebda; background-image: linear-gradient(#eccab050 1px, transparent 1px), linear-gradient(90deg, #eccab050 1px, transparent 1px); background-size: 22px 22px; transform: rotate(-8deg); }
.portrait figcaption { display: inline-block; margin-top: 8px; padding: 3px 18px; background: #f8e6a9; font-size: 12px; transform: rotate(-5deg); }
.star { position: absolute; font-size: 48px; color: #d3a155; }.star-one { top: 10%; left: 0; }.star-two { bottom: 20%; right: -10px; font-size: 34px; }
.section { margin-top: 45px; scroll-margin-top: 25px; }
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 27px; padding-bottom: 13px; border-bottom: 1px dashed #decabd; }
.section-number { font-family: Georgia, serif; font-style: italic; font-size: 21px; color: #c9999c; }
h2 { font-family: 'Songti SC', STSong, serif; font-size: 24px; font-weight: 600; }
.scribble { margin-left: auto; color: #bb9691; font: italic 15px Georgia, serif; transform: rotate(-4deg); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.note { position: relative; padding: 28px; background: #fff8e8; border: 1px solid #eedcc0; box-shadow: 3px 5px 0 #ede2d440; transform: rotate(-1deg); }
.tape { position: absolute; width: 95px; height: 24px; background: #e9b8bb90; top: -12px; left: calc(50% - 47px); transform: rotate(4deg); }
h3 { font-size: 18px; margin-bottom: 15px; }
dl { margin: 0; font-size: 13px; }dl div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dashed #e5d7be; }dt { color: #9f8063; }dd { margin: 0; }
.small-note { margin-top: 18px; font-size: 11px; color: #a0876c; }
.about-note h3 { font-family: 'Songti SC', STSong, serif; font-size: 28px; line-height: 1.55; }.about-note p { margin-top: 15px; font-size: 13px; }
.underline-note { text-decoration: underline; text-decoration-color: #e5b7bd; text-underline-offset: 5px; }
/* 便签在窄屏按阅读顺序排列，避免旋转装饰导致横向溢出。 */
.scraps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.scrap { padding: 25px 21px; border-radius: 2px; box-shadow: 2px 4px 8px #754c340c; }.scrap-pink { background: #fcebed; transform: rotate(-2deg); }.scrap-yellow { background: #fff2cc; transform: rotate(1deg); }.scrap-green { background: #edf0e3; transform: rotate(-1deg); }
.scrap-index { font-size: 10px; color: #a18176; letter-spacing: 1px; }.scrap h3 { font-size: 16px; margin-top: 17px; }.scrap p { font-size: 12px; }.scrap .hand-note { margin-top: 20px; font-family: 'Kaiti SC', STKaiti, KaiTi, serif; font-size: 15px; color: #a57768; }
.postcard { display: grid; grid-template-columns: 1fr 210px; gap: 25px; padding: 30px; border: 1px solid #dbc6b2; background: repeating-linear-gradient(0deg, transparent 0 30px, #ecdcc733 30px 31px); }.postcard-copy { position: relative; }.postmark { float: right; border: 2px double #cba994; border-radius: 50%; width: 70px; height: 70px; display: grid; place-content: center; text-align: center; font-size: 9px; line-height: 1.6; transform: rotate(12deg); color: #b0927d; margin-left: 12px; }.postcard h3 { margin-top: 12px; font-size: 19px; }.postcard p { font-size: 13px; margin-top: 12px; }.postcard img { align-self: center; transform: rotate(7deg); }.postcard-sign { display: block; margin-top: 17px; color: #bc8891; font-family: 'Kaiti SC', STKaiti, KaiTi, serif; font-size: 20px; }
.closing { margin-top: 55px; padding: 35px 20px; display: flex; align-items: center; justify-content: center; gap: 45px; background: #f8eee7; border-radius: 50% 4px 4px 4px / 10% 4px 4px 4px; }.closing img { width: 180px; transform: rotate(-5deg); }.closing h2 { margin: 12px 0; font-size: 28px; line-height: 1.5; }.closing p { font-size: 13px; color: var(--muted); }.home-button { display: inline-block; margin-top: 20px; background: #785043; color: #fffaf2; font-size: 12px; padding: 9px 19px; border-radius: 22px; }.home-button:hover { background: #9a6958; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 45px; padding-top: 15px; border-top: 1px solid #e9d9c8; font-size: 10px; color: #a48a78; }
/* 平板保留双栏封面，缩小纸张边距；手机转为单栏并收起书脊。 */
@media (max-width: 1180px) { .notebook { margin-left: 30px; margin-right: 48px; } }
@media (max-width: 900px) { .page-content { padding: 28px 30px 25px 60px; }.cover { min-height: 530px; }.portrait img { max-height: 430px; }.profile-grid { gap: 25px; }.scraps { gap: 12px; }.scrap { padding: 22px 16px; }.scribble { display: none; }.postcard { grid-template-columns: 1fr 150px; padding: 23px; }.closing { gap: 25px; } }
@media (max-width: 600px) { .topbar { padding: 18px 20px; }.brand { font-size: 17px; }.brand span { display: none; }.notebook { margin: 8px 14px 35px; border-radius: 6px 14px 14px 6px; }.binding, .book-tab { display: none; }.page-content { padding: 22px 22px 20px; }.page-heading { font-size: 8px; letter-spacing: 1px; }.cover { grid-template-columns: 1fr; gap: 0; }.cover-copy { padding-top: 32px; }h1 { font-size: 57px; }.intro { font-size: 14px; }blockquote { font-size: 29px; margin-top: 22px; }.portrait { width: min(100%, 330px); margin: 8px auto 0; }.portrait img { max-height: 390px; }.section { margin-top: 35px; }h2 { font-size: 21px; }.section-title { gap: 9px; }.profile-grid, .scraps { grid-template-columns: 1fr; gap: 26px; }.note { padding: 24px; }.about-note { padding: 0 3px; }.scrap { padding: 24px; }.scrap p { font-size: 13px; }.postcard { grid-template-columns: 1fr; gap: 8px; padding: 22px; }.postcard img { width: 155px; justify-self: end; }.closing { flex-direction: column; align-items: flex-start; gap: 16px; padding: 26px; }.closing img { width: 130px; align-self: center; }.closing h2 { font-size: 25px; }.page-footer { flex-direction: column; gap: 5px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* 三列导航使标题始终位于视口中央；左侧返回链接允许自然换行。 */
/* 拉丁语的长句与纵向页签允许自然换行，保持笔记内容宽度稳定。 */
.page-content { overflow-wrap: anywhere; }
.book-tab { max-height: 230px; }
@media (max-width: 600px) { .section-title { align-items: flex-start; } }

/* 横向分页使用原生 overflow 与吸附，图片懒加载；无轮播框架或自动播放。 */
.gallery-intro { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.gallery-controls { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 14px; }
.gallery-controls button { width: 40px; height: 40px; border: 1px solid #decabd; border-radius: 50%; color: var(--ink); background: #fff8ee; font-size: 20px; cursor: pointer; }
.gallery-controls button:hover:not(:disabled) { background: #f2dfd2; }
.gallery-controls button:disabled { opacity: .35; cursor: default; }
.gallery-controls button:focus-visible, .gallery-track:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
.gallery-controls [data-gallery-status] { min-width: 38px; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gallery-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 24px) / 2); gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #d8b9a5 transparent; padding-bottom: 12px; }
.gallery-card { min-width: 0; margin: 0; padding: 12px; border: 1px solid #e8d8c8; background: #fffaf2; box-shadow: 3px 5px 0 #ede2d440; scroll-snap-align: start; }
.gallery-card a { display: block; }
.gallery-card img { width: 100%; object-fit: contain; }
.comic-gallery img { aspect-ratio: 2 / 3; }
.gallery-card figcaption { margin-top: 10px; font-size: 13px; line-height: 1.6; }
.original-link { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.sticker-gallery { grid-auto-columns: calc((100% - 48px) / 4); gap: 16px; }
.sticker-gallery .gallery-card { background: #f9eee8; border-radius: 12px; }
.sticker-gallery img { aspect-ratio: 1; }
/* 最后一张留言与素材一起翻页，不占用额外长段落。 */
.gallery-update { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; background: #f6eadc; }
.gallery-update > span { color: #c49862; font-size: 42px; }
.gallery-update h3 { font-size: 17px; margin: 10px 0; }
.gallery-update p { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .sticker-gallery { grid-auto-columns: calc((100% - 16px) / 2); } }
@media (max-width: 600px) { .comic-gallery { grid-auto-columns: 100%; gap: 20px; }.sticker-gallery { grid-auto-columns: calc((100% - 12px) / 2); gap: 12px; }.gallery-card { padding: 9px; }.gallery-update { padding: 18px; } }

/* 全屏大图预览：铺满可见视口；图片区域独立滚动，标题与翻页按钮始终可用。 */
html.image-preview-open { overflow: hidden; }
.image-preview { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; color: var(--ink); background: #fffaf3; box-shadow: 0 24px 80px #39251d40; }
.image-preview[open] { display: flex; flex-direction: column; }
.image-preview::backdrop { background: #241c19b3; }
.image-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #e8d8c8; }
.image-preview-heading h2 { min-width: 0; font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.image-preview-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.image-preview-actions button { min-height: 38px; padding: 5px 12px; border: 1px solid #decabd; border-radius: 9px; color: inherit; background: #f7ece1; font: inherit; font-size: 12px; cursor: pointer; }
.image-preview-actions [data-image-close] { width: 38px; padding: 0; font-size: 24px; }
.image-preview-actions button:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.image-preview-stage { flex: 1; min-height: 0; overflow: auto; padding: 16px; overscroll-behavior: contain; }
.image-preview-stage img { width: 100%; height: 100%; object-fit: contain; }
/* 放大保留图像完整比例；原图在窄屏可横向平移，适应按钮始终留在标题栏。 */
.image-preview.is-zoomed .image-preview-stage img { width: auto; height: auto; max-width: none; margin: auto; }
@media (max-width: 600px) { .image-preview-heading { padding: 10px; gap: 8px; }.image-preview-heading h2 { font-size: 15px; }.image-preview-stage { padding: 8px; } }

/* 独立底栏适配触屏与键鼠，禁用首尾按钮，避免误以为可以跨栏目翻页。 */
.image-preview-navigation { display: flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 24px; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid #e8d8c8; }
.image-preview-navigation button { width: 44px; height: 44px; border: 1px solid #decabd; border-radius: 50%; background: #f7ece1; color: var(--ink); font-size: 22px; cursor: pointer; }
.image-preview-navigation button:disabled { opacity: .35; cursor: default; }
.image-preview-navigation button:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
.image-preview-navigation span { min-width: 54px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
