nomadro/apps/miniprogram/xhs/tool/ebook-book.css
eric 626f6b19e8 Ship unified miniprogram H5/weapp parity and XHS offline portal.
Align Taro pages with Next hub/nav/book/community/VIP, pack the single-index Xiaohongshu portal with host-chrome safe areas, and refresh shared book content plus portal README constraints.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 09:37:03 +08:00

423 lines
8.5 KiB
CSS
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* ===== ebook-book.css — 对齐 apps/ebook/redmini 封面+阅读器(作用域 #view-book) ===== */
#view-book {
--r-bg: #0c0b12;
--r-bg2: #15101f;
--r-text: #f3eefc;
--r-muted: #b4a9c8;
--r-accent: #ff7ab6;
--r-accent2: #a78bfa;
--r-soft: rgba(255, 255, 255, 0.06);
--r-border: rgba(255, 255, 255, 0.1);
--r-paper: rgba(28, 22, 45, 0.92);
--r-chrome: rgba(12, 11, 18, 0.94);
background: var(--r-bg);
color: var(--r-text);
min-height: 100vh;
}
#view-book .ebook-home {
position: relative;
min-height: 100vh;
overflow: hidden;
padding: calc(24px + env(safe-area-inset-top, 0px)) 20px calc(28px + env(safe-area-inset-bottom, 0px));
box-sizing: border-box;
}
#view-book .ebook-home .bg-layer {
position: absolute;
inset: 0;
pointer-events: none;
overflow: hidden;
}
#view-book .ebook-home .orb {
position: absolute;
border-radius: 50%;
filter: blur(60px);
opacity: 0.45;
}
#view-book .ebook-home .orb-a {
width: 220px;
height: 220px;
background: #ff7ab6;
top: -60px;
right: -40px;
}
#view-book .ebook-home .orb-b {
width: 180px;
height: 180px;
background: #a78bfa;
bottom: 80px;
left: -50px;
}
#view-book .ebook-stage {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
gap: 14px;
max-width: 420px;
margin: 0 auto;
}
#view-book .ebook-back {
align-self: flex-start;
border: none;
background: rgba(255, 255, 255, 0.06);
color: var(--r-muted);
border-radius: 12px;
width: 40px;
height: 40px;
font-size: 1.1rem;
cursor: pointer;
}
#view-book .brand-block .brand {
margin: 0;
font-size: 0.78rem;
letter-spacing: 0.18em;
color: var(--r-muted);
text-transform: uppercase;
}
#view-book .brand-block .brand-line {
margin: 4px 0 0;
font-size: 0.85rem;
color: var(--r-text);
opacity: 0.85;
}
#view-book .cover-wrap {
position: relative;
margin: 10px 0 4px;
}
#view-book .cover-glow {
position: absolute;
inset: -18%;
border-radius: 32px;
filter: blur(28px);
opacity: 0.55;
background: radial-gradient(circle, rgba(255, 122, 182, 0.45), transparent 70%);
}
#view-book .cover {
position: relative;
width: min(58vw, 220px);
aspect-ratio: 3 / 4;
border: none;
border-radius: 18px;
background: linear-gradient(155deg, #ff7ab6 0%, #a78bfa 42%, #4ecdc4 100%);
box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10px;
cursor: pointer;
color: #fff;
overflow: hidden;
}
#view-book .cover-emoji {
font-size: 3rem;
line-height: 1;
}
#view-book .cover-title {
font-size: 1.15rem;
font-weight: 800;
padding: 0 12px;
}
#view-book .ebook-home .title {
margin: 6px 0 0;
font-size: 1.65rem;
font-weight: 800;
color: var(--r-text);
}
#view-book .ebook-home .tease {
margin: 0;
font-size: 0.92rem;
color: var(--r-muted);
line-height: 1.5;
max-width: 18em;
}
#view-book .ebook-home .author {
margin: 0;
font-size: 0.82rem;
color: var(--r-muted);
}
#view-book .cta-area {
width: 100%;
margin-top: 8px;
display: flex;
flex-direction: column;
gap: 8px;
}
#view-book .cta {
width: 100%;
min-height: 52px;
border: none;
border-radius: 999px;
font-size: 1.05rem;
font-weight: 800;
color: #1a1020;
background: linear-gradient(135deg, #ff7ab6, #ffe66d, #a78bfa);
box-shadow: 0 10px 28px rgba(255, 122, 182, 0.35);
cursor: pointer;
}
#view-book .resume-hint {
margin: 0;
font-size: 0.78rem;
color: var(--r-muted);
}
/* reader */
#view-book .ebook-reader {
position: relative;
min-height: 100vh;
background: var(--r-bg);
color: var(--r-text);
padding-top: var(--app-pad-top, 88px);
box-sizing: border-box;
}
#view-book .ebook-topbar {
position: sticky;
top: var(--app-pad-top, 88px);
z-index: 40;
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px 10px var(--app-pad-left, 16px);
background: var(--r-chrome);
backdrop-filter: blur(14px);
border-bottom: 1px solid var(--r-border);
box-sizing: border-box;
}
#view-book .ebook-topbar .top-btn {
width: 40px;
height: 40px;
border-radius: 12px;
border: 1px solid var(--r-border);
background: var(--r-soft);
color: var(--r-text);
font-size: 1rem;
cursor: pointer;
}
#view-book .ebook-topbar .top-center {
flex: 1;
min-width: 0;
text-align: center;
}
#view-book .ebook-topbar .top-title {
margin: 0;
font-size: 0.92rem;
font-weight: 700;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#view-book .ebook-topbar .top-sub {
margin: 2px 0 0;
font-size: 0.72rem;
color: var(--r-muted);
}
#view-book .paper {
padding: 16px 18px calc(48px + env(safe-area-inset-bottom, 0px));
max-width: 720px;
margin: 0 auto;
}
#view-book .hero-card {
text-align: center;
padding: 20px 12px 24px;
margin-bottom: 8px;
}
#view-book .hero-emoji {
display: block;
font-size: 2.4rem;
}
#view-book .hero-title {
display: block;
margin-top: 8px;
font-size: 1.45rem;
font-weight: 800;
}
#view-book .hero-sub {
display: block;
margin-top: 6px;
color: var(--r-muted);
font-size: 0.9rem;
}
#view-book .hero-stats {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 8px;
margin-top: 16px;
}
#view-book .hero-stats .stat {
background: var(--r-soft);
border: 1px solid var(--r-border);
border-radius: 12px;
padding: 10px 4px;
}
#view-book .stat-n {
display: block;
font-weight: 800;
font-size: 1rem;
}
#view-book .stat-l {
display: block;
font-size: 0.7rem;
color: var(--r-muted);
margin-top: 2px;
}
#view-book .chapter-block {
margin: 8px 0 28px;
}
#view-book .chapter-divider {
text-align: center;
color: var(--r-muted);
margin: 18px 0;
letter-spacing: 0.4em;
}
#view-book .chapter-hero {
margin-bottom: 12px;
}
#view-book .chapter-hero-top {
display: flex;
align-items: center;
justify-content: space-between;
}
#view-book .chapter-hero-emoji {
font-size: 1.6rem;
}
#view-book .chapter-ring {
font-size: 0.78rem;
color: var(--r-muted);
}
#view-book .chapter-title {
display: block;
margin-top: 8px;
font-size: 1.25rem;
font-weight: 800;
}
#view-book .chapter-meta {
display: block;
margin-top: 4px;
font-size: 0.78rem;
color: var(--r-muted);
}
#view-book .next-peek {
margin-top: 16px;
padding: 12px 14px;
border-radius: 14px;
border: 1px dashed var(--r-border);
background: var(--r-soft);
width: 100%;
text-align: left;
color: inherit;
cursor: pointer;
}
#view-book .next-peek-label {
display: block;
font-size: 11px;
letter-spacing: 0.12em;
color: var(--r-muted);
}
#view-book .next-peek-title {
display: block;
margin-top: 4px;
font-size: 15px;
font-weight: 600;
}
#view-book .fin {
margin: 28px 0 24px;
padding: 20px 10px 12px;
text-align: center;
border-top: 1px dashed var(--r-border);
}
#view-book .fin-title {
display: block;
margin-top: 6px;
font-size: 20px;
font-weight: 700;
}
#view-book .fin-desc {
display: block;
margin-top: 4px;
font-size: 13px;
color: var(--r-muted);
}
#view-book .fin-actions {
margin-top: 14px;
display: flex;
gap: 10px;
justify-content: center;
flex-wrap: wrap;
}
#view-book .fin-btn {
padding: 10px 18px;
border-radius: 999px;
border: none;
background: linear-gradient(135deg, var(--r-accent), var(--r-accent2));
color: #fff;
font-size: 14px;
font-weight: 600;
cursor: pointer;
}
#view-book .fin-btn.ghost {
background: var(--r-soft);
border: 1px solid var(--r-border);
color: var(--r-text);
}
/* toc drawer */
#view-book .toc-mask {
position: fixed;
inset: 0;
z-index: 80;
background: rgba(0, 0, 0, 0.45);
display: none;
}
#view-book .toc-mask.open {
display: block;
}
#view-book .toc-drawer {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: min(86vw, 320px);
background: var(--r-bg2);
border-right: 1px solid var(--r-border);
padding: calc(16px + var(--app-pad-top, 0px)) 14px 20px;
overflow-y: auto;
box-sizing: border-box;
}
#view-book .toc-drawer .drawer-title {
margin: 0 0 12px;
font-size: 1.1rem;
font-weight: 800;
}
#view-book .toc-item {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
text-align: left;
padding: 12px 10px;
margin-bottom: 6px;
border-radius: 12px;
border: 1px solid transparent;
background: transparent;
color: var(--r-text);
cursor: pointer;
}
#view-book .toc-item.active,
#view-book .toc-item:active {
background: var(--r-soft);
border-color: var(--r-border);
}
#view-book .toc-item .n {
color: var(--r-muted);
font-size: 0.75rem;
width: 1.6em;
}
#view-book .toc-item .t {
flex: 1;
font-size: 0.9rem;
line-height: 1.35;
}