/* 复刻 nomadbook 电子书样式 */ .readingProgress { position: fixed; top: 0; left: 0; height: 4px; background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%); z-index: 201; transition: width 0.15s linear; border-radius: 0 4px 4px 0; } .headerSpacer { width: 100%; height: 88px; } .header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 88px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(0, 0, 0, 0.06); display: flex; flex-direction: row; align-items: center; justify-content: space-between; } .headerLeft { width: 100px; display: flex; align-items: center; justify-content: center; color: #1a1a2e; cursor: pointer; } .headerMiddle { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; color: #1a1a2e; letter-spacing: 2px; } .headerRight { width: 72px; height: 72px; padding: 0; display: flex; align-items: center; justify-content: center; color: #4facfe; cursor: pointer; margin-right: 10px; background: #f0f7ff; border-radius: 50%; transition: all 0.2s ease; } .headerRight:hover { background: #dceeff; } .headerRightActive { background: #4facfe !important; color: #fff !important; } .chunkEnter { animation: chunkAppear 0.5s ease-out both; } @keyframes chunkAppear { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .chunkPlaceholder { background: linear-gradient(90deg, #f6f7f8 25%, #edeef1 37%, #f6f7f8 63%); background-size: 400% 100%; animation: shimmer 1.8s ease infinite; border-radius: 12px; margin: 24px 0; } @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } } .loadingSpinner { width: 56px; height: 56px; border: 5px solid #f0f0f0; border-top-color: #4facfe; border-radius: 50%; animation: spin 0.8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } .backToTop { position: fixed; bottom: 120px; right: 30px; width: 80px; height: 80px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); cursor: pointer; z-index: 50; animation: fadeInUp 0.3s ease; color: #4facfe; transition: transform 0.2s ease, box-shadow 0.2s ease; } .backToTop:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12); } @keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } } .book { padding: 30px; max-width: 100%; } .markdownBody { font-size: 16px !important; line-height: 1.85 !important; color: #2c3e50 !important; word-wrap: break-word; overflow-wrap: break-word; } .markdownBody h1 { font-size: 24px !important; font-weight: 800; color: #1a1a2e; margin: 28px 0 10px; padding-bottom: 0; border-bottom: none; line-height: 1.3; } .markdownBody h1::after { content: ""; display: block; width: 40px; height: 3px; background: linear-gradient(90deg, #4facfe, #00f2fe); border-radius: 3px; margin-top: 8px; } .markdownBody h2 { font-size: 21px !important; font-weight: 700; color: #2c3e50; margin: 22px 0 9px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; line-height: 1.3; } .markdownBody h3 { font-size: 18px !important; font-weight: 600; color: #34495e; margin: 18px 0 7px; } .markdownBody h4, .markdownBody h5, .markdownBody h6 { font-size: 16px !important; font-weight: 600; color: #4a5568; margin: 14px 0 6px; } .markdownBody p { font-size: 16px !important; margin-bottom: 10px; line-height: 1.9; } .markdownBody blockquote { position: relative; margin: 28px 0; padding: 20px 24px 20px 30px; border-left: none; background: linear-gradient(135deg, #f8fbff 0%, #f0f7ff 100%); border-radius: 0 12px 12px 0; color: #4a5568; } .markdownBody blockquote::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(180deg, #4facfe, #00f2fe); border-radius: 3px; } .markdownBody pre { position: relative; margin: 28px 0; padding: 28px 24px 24px; background: #1e1e2e; border-radius: 12px; overflow-x: auto; } .markdownBody pre::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #4facfe, #00f2fe); border-radius: 12px 12px 0 0; } .markdownBody pre code { font-family: "SF Mono", "Fira Code", Menlo, Monaco, Consolas, monospace; font-size: 13px !important; line-height: 1.6; color: #e2e8f0; background: none !important; padding: 0; } .markdownBody code { font-family: "SF Mono", "Fira Code", Menlo, Monaco, Consolas, monospace; font-size: 14px !important; padding: 2px 6px; background: #f1f5f9; color: #e53e3e; border-radius: 6px; } .markdownBody a { color: #4facfe; text-decoration: none; } .markdownBody a:hover { color: #2b8de3; border-bottom: 1px solid #4facfe; } .markdownBody img { display: block; margin: 28px auto; max-width: 100%; height: auto; border-radius: 8px; } .markdownBody ul, .markdownBody ol { margin: 16px 0; padding-left: 40px; } .markdownBody table { width: 100%; margin: 28px 0; border-collapse: collapse; border-radius: 8px; } .markdownBody th { background: linear-gradient(135deg, #f8fafc, #edf2f7); font-weight: 600; padding: 16px 20px; text-align: left; border: 1px solid #e2e8f0; } .markdownBody td { padding: 14px 20px; border: 1px solid #e2e8f0; } .markdownBody tr:nth-child(even) { background: #f8fafc; } /* 抽屉目录 */ .drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 280px; max-width: 85vw; background: #fff; box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1); z-index: 150; padding-top: 88px; overflow-y: auto; transform: translateX(100%); transition: transform 0.3s ease; } .drawerOpen { transform: translateX(0); } .drawerMask { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 140; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; } .drawerMaskOpen { opacity: 1; pointer-events: auto; } .drawerItem { padding: 16px 20px; border-bottom: 1px solid #f5f5f5; color: #2c3e50; cursor: pointer; font-size: 15px; transition: background 0.15s; } .drawerItem:hover { background: #f0f7ff; } /* PC 适配 */ @media (min-width: 768px) { .headerSpacer { height: 56px; } .header { height: 56px; } .headerMiddle { font-size: 18px; } .headerRight { width: auto; height: 34px; padding: 0 14px; margin-right: 16px; gap: 5px; border-radius: 17px; font-size: 13px; } .book { padding: 30px 60px; } .markdownBody { font-size: 16px !important; line-height: 1.8 !important; max-width: 800px; margin: 0 auto; } .markdownBody h1 { font-size: 28px !important; margin: 36px 0 14px; } .markdownBody h1::after { width: 50px; height: 3px; margin-top: 10px; } .markdownBody h2 { font-size: 23px !important; margin: 28px 0 12px; padding-bottom: 8px; } .markdownBody h3 { font-size: 19px !important; margin: 22px 0 10px; } .markdownBody p { font-size: 16px !important; margin-bottom: 14px; } .markdownBody pre code { font-size: 14px !important; } .markdownBody code { font-size: 14px !important; padding: 2px 6px; } .backToTop { width: 44px; height: 44px; bottom: 40px; right: 40px; } .drawer { padding-top: 56px; width: 300px; } .drawerItem { font-size: 14px; padding: 14px 18px; } } @media (min-width: 1024px) { .book { padding: 30px 80px; } .markdownBody { width: 720px; font-size: 17px !important; line-height: 1.85 !important; } .markdownBody h1 { font-size: 30px !important; } .markdownBody h2 { font-size: 25px !important; } .markdownBody h3 { font-size: 20px !important; } .markdownBody p { font-size: 17px !important; } .markdownBody img.loaded:hover { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); transform: translateY(-2px); } }