/* 留言板按钮容器 */ .guestbook-btn-container { position: fixed; top: 20px; right: 80px; z-index: 999; } /* 博客文章按钮容器 */ .blog-posts-btn-container { position: fixed; top: 115px; right: 80px; z-index: 999; } /* 旅途剪影按钮容器 */ .photo-album-btn-container { position: fixed; top: 210px; right: 80px; z-index: 999; } /* 透明桥梁:向左延伸覆盖预览面板区域,确保鼠标滑入时 hover 不中断 */ .guestbook-btn-container::after, .blog-posts-btn-container::after, .photo-album-btn-container::after { content: ''; position: absolute; right: 80px; /* 从容器的左边缘开始 */ top: 0; width: 200px; /* 15px 间距 + 380px 预览面板宽度 */ height: 80px; /* 与按钮高度一致 */ background: transparent; pointer-events: auto; } .guestbook-btn { background: #fff; border: 1px solid #e8e8e8; border-radius: 50%; width: 80px; height: 80px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); } .blog-posts-btn { background: #fff; border: 1px solid #e8e8e8; border-radius: 50%; width: 80px; height: 80px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); } .photo-album-btn { background: #fff; border: 1px solid #e8e8e8; border-radius: 50%; width: 80px; height: 80px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); } .btn-label { font-size: 13px; color: #666; line-height: 1; } .guestbook-btn:hover, .blog-posts-btn:hover { border-color: #d0d0d0; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); transform: translateY(-2px) scale(1.05); } .guestbook-btn svg, .blog-posts-btn svg { width: 32px; height: 32px; } .guestbook-btn svg path, .blog-posts-btn svg path { transition: stroke 0.3s ease; } .guestbook-btn:hover svg path, .blog-posts-btn:hover svg path { stroke: #333; } /* Hover 浮动预览面板 */ .guestbook-preview, .blog-posts-preview, .photo-album-preview { visibility: hidden; position: absolute; top: 0; right: calc(100% + 15px); /* 在按钮左侧显示 */ width: 380px; max-height: 400px; background: linear-gradient(to bottom, #fafafa, #fff); border-radius: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08); z-index: 1000; opacity: 0; transform: translateX(20px) scale(0.95); transform-origin: center right; transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.5s; overflow: hidden; border: 1px solid rgba(240, 240, 240, 0.8); pointer-events: none; backdrop-filter: blur(20px); } /* 当鼠标悬停在容器上时显示预览面板 */ .guestbook-btn-container:hover .guestbook-preview, .blog-posts-btn-container:hover .blog-posts-preview, .photo-album-btn-container:hover .photo-album-preview { visibility: visible; opacity: 1; transform: translateX(0) scale(1); pointer-events: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.1); } .preview-header { padding: 14px 18px; border-bottom: 1px solid #f0f0f0; background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); } .preview-header h3 { margin: 0; font-size: 15px; color: #333; font-weight: 500; letter-spacing: 0.5px; } .preview-body { padding: 0; overflow-y: auto; max-height: calc(400px - 50px); } .preview-item { padding: 12px 18px; border-bottom: 1px solid #f5f5f5; transition: background 0.2s ease; } .preview-item:last-child { border-bottom: none; } .preview-item:hover { background: #fafafa; } .preview-nickname { font-weight: 500; color: #333; font-size: 13px; margin-bottom: 4px; } .preview-content { color: #666; font-size: 12px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .preview-time { color: #999; font-size: 11px; margin-top: 4px; } .preview-complete { text-align: center; padding: 15px; color: #bbb; font-size: 12px; font-style: italic; } /* 完整留言板弹窗(点击后显示) */ .guestbook-full-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 10000; justify-content: center; align-items: center; animation: fadeIn 0.3s ease; } .guestbook-full-modal.active { display: flex; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .full-modal-content { background: #fff; border-radius: 12px; width: 92%; max-width: 850px; max-height: 92vh; overflow: hidden; box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18); animation: slideUp 0.3s ease; } @keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } /* Toast 弹窗 */ .toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 100000; pointer-events: none; } .toast { background: rgba(51, 51, 51, 0.95); color: #fff; padding: 12px 24px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; opacity: 0; transform: translateY(-20px); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); backdrop-filter: blur(10px); } .toast.show { opacity: 1; transform: translateY(0); } .toast.success { background: rgba(76, 175, 80, 0.95); } .toast.error { background: rgba(244, 67, 54, 0.95); } /* 留言板模态框 */ .guestbook-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 10000; animation: fadeIn 0.3s ease; } .guestbook-modal.active { display: flex; justify-content: center; align-items: center; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .guestbook-content { background: #fff; border-radius: 8px; width: 90%; max-width: 800px; max-height: 85vh; overflow: hidden; /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); */ animation: slideUp 0.3s ease; } @keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } .guestbook-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); } .guestbook-header h2 { margin: 0; font-size: 16px; color: #333; font-weight: 500; letter-spacing: 0.5px; } .guestbook-close { background: none; border: none; font-size: 24px; color: #999; cursor: pointer; line-height: 1; padding: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; transition: color 0.3s ease; } .guestbook-close:hover { color: #333; } .guestbook-body { padding: 0; overflow-y: auto; max-height: calc(92vh - 60px); } /* 留言表单 - 固定在顶部 */ .guestbook-form { margin-bottom: 15px; padding: 15px 20px; border-bottom: 1px solid #eee; position: sticky; top: 0; background: #fff; z-index: 10; } /* 留言列表 */ .guestbook-list { display: flex; flex-direction: column; gap: 8px; padding: 15px 20px; } .guestbook-item { padding: 10px 12px; border: 1px solid #f0f0f0; border-radius: 6px; background: #fff; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); margin-bottom: 0; } .guestbook-item:hover { border-color: #e0e0e0; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); transform: translateY(-1px); } .guestbook-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #f5f5f5; } /* 头像样式 */ .guestbook-item-header > div:first-child img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid #f5f5f5; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06); } .guestbook-item:hover .guestbook-item-header > div:first-child img { border-color: #e0e0e0; transform: scale(1.05); } .guestbook-reply .guestbook-item-header > div:first-child img { width: 28px; height: 28px; } .guestbook-nickname { font-weight: 500; color: #333; font-size: 13px; } .guestbook-nickname a { color: #333; text-decoration: none; border-bottom: 1px dotted #999; transition: all 0.3s ease; } .guestbook-nickname a:hover { color: #000; border-bottom-color: #333; } .guestbook-meta { font-size: 11px; color: #999; } .guestbook-content { color: #555; line-height: 1.6; font-size: 13px; word-wrap: break-word; padding: 4px 0; } /* 美化留言内容中的 HTML 元素 */ .guestbook-content p { margin: 0 0 6px 0; line-height: 1.6; } .guestbook-content p:last-child { margin-bottom: 0; } .guestbook-content a { color: #333; text-decoration: none; border-bottom: 1px dotted #999; transition: all 0.3s ease; } .guestbook-content a:hover { color: #000; border-bottom-color: #333; } .guestbook-content img { max-width: 100%; height: auto; border-radius: 4px; margin: 6px 0; } .guestbook-content blockquote { margin: 6px 0; padding: 8px 12px; background: #f9f9f9; border-left: 3px solid #ddd; color: #666; font-style: italic; } .guestbook-content code { background: #f5f5f5; padding: 2px 6px; border-radius: 3px; font-family: 'Courier New', monospace; font-size: 13px; color: #e74c3c; } .guestbook-content pre { background: #f5f5f5; padding: 8px; border-radius: 4px; overflow-x: auto; margin: 6px 0; } .guestbook-content pre code { background: none; padding: 0; color: #333; } /* 留言底部信息(浏览器、系统、地址) */ .guestbook-footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f5f5f5; } .guestbook-info-item { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #999; transition: color 0.3s ease; } .guestbook-info-item svg { opacity: 0.6; } .guestbook-info-item:hover { color: #666; } .guestbook-reply { margin-top: 15px; padding: 12px 15px; background: #f9f9f9; border-radius: 4px; border-left: 3px solid #ddd; } .guestbook-reply .guestbook-item { background: transparent; border: none; padding: 10px 0; margin-bottom: 10px; } .guestbook-reply .guestbook-item:last-child { margin-bottom: 0; } .guestbook-reply .guestbook-item:hover { box-shadow: none; } .guestbook-reply .guestbook-nickname { font-size: 13px; color: #666; } .guestbook-reply .guestbook-content { font-size: 13px; color: #777; line-height: 1.6; } /* 留言表单 - 固定在顶部 */ .guestbook-form { margin-bottom: 12px; padding: 12px 20px; border-bottom: 1px solid #eee; position: sticky; top: 0; background: #fff; z-index: 10; } .form-row { display: flex; gap: 8px; margin-bottom: 8px; } .form-group { flex: 1; } .form-group-full { margin-bottom: 8px; } .form-group label { display: block; margin-bottom: 3px; color: #666; font-size: 11px; } .form-group input, .form-group textarea, .form-group-full textarea { width: 100%; padding: 6px 10px; border: 1px solid #e8e8e8; border-radius: 4px; font-size: 12px; color: #333; background: #fafafa; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); font-family: inherit; box-sizing: border-box; } .form-group input:focus, .form-group textarea:focus, .form-group-full textarea:focus { outline: none; border-color: #999; background: #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05); } .form-group textarea, .form-group-full textarea { resize: vertical; min-height: 50px; line-height: 1.5; font-family: inherit; } .form-group textarea::placeholder, .form-group-full textarea::placeholder { color: #bbb; } .form-submit { text-align: right; margin-top: 10px; } .submit-btn { background: #333; color: #fff; border: none; padding: 8px 20px; border-radius: 4px; cursor: pointer; font-size: 13px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); } .submit-btn:hover { background: #000; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); } .submit-btn:active { transform: translateY(0); } .submit-btn:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; } /* 加载状态 */ .guestbook-loading { text-align: center; padding: 30px 25px; color: #999; font-size: 14px; } .guestbook-empty { text-align: center; padding: 40px 25px; color: #999; font-size: 14px; } /* 加载更多按钮 */ .load-more-btn { display: block; margin: 20px auto 20px auto; background: #fff; border: 1px solid #e8e8e8; color: #666; padding: 10px 30px; border-radius: 20px; cursor: pointer; font-size: 13px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); } .load-more-btn:hover { border-color: #999; color: #333; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); transform: translateY(-1px); } .load-more-btn:disabled { color: #ccc; border-color: #eee; cursor: not-allowed; } /* 加载完成提示 */ .load-complete { text-align: center; padding: 20px 25px; color: #bbb; font-size: 13px; font-style: italic; } /* 博客文章列表样式 */ .blog-post-item { padding: 12px; border-bottom: 1px solid #f5f5f5; transition: background-color 0.3s ease; } .blog-post-item:last-child { border-bottom: none; } .blog-post-item:hover { background-color: #fafafa; } .blog-post-title { font-size: 14px; color: #333; margin-bottom: 6px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .blog-post-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #999; } .blog-post-category { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; font-size: 10px; } /* 旅途剪影预览面板样式 - 列表模式 */ .photo-album-container { padding: 10px; } .photo-preview-item { margin-bottom: 10px; cursor: pointer; transition: transform 0.3s ease; } .photo-preview-item:hover { transform: scale(1.05); } .photo-preview-item img { width: 100%; height: 120px; object-fit: cover; display: block; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); } /* 旅途剪影瀑布流布局 */ .photo-album-grid { column-count: 3; column-gap: 15px; padding: 20px; } @media (max-width: 1200px) { .photo-album-grid { column-count: 2; } } @media (max-width: 768px) { .photo-album-grid { column-count: 2; column-gap: 10px; padding: 10px; } } .photo-album-item { break-inside: avoid; margin-bottom: 15px; position: relative; overflow: hidden; border-radius: 12px; cursor: pointer; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); background-color: #f0f0f0; /* 占位背景色 */ min-height: 200px; /* 最小高度,防止塌陷 */ } .photo-album-item:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); } .photo-album-item img { width: 100%; height: auto; display: block; opacity: 0; /* 初始隐藏,加载完再显示 */ transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); } .photo-album-item:hover img { transform: scale(1.1); } /* 照片放大弹窗 */ .photo-lightbox { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.95); z-index: 10000; justify-content: center; align-items: center; animation: fadeIn 0.3s ease; } .photo-lightbox.active { display: flex; } .photo-lightbox img { max-width: 85%; max-height: 85%; object-fit: contain; border-radius: 8px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); transition: opacity 0.3s ease; } .photo-lightbox-close { position: absolute; top: 30px; right: 40px; font-size: 40px; color: #fff; cursor: pointer; transition: transform 0.3s ease; z-index: 10001; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.1); border-radius: 50%; } .photo-lightbox-close:hover { transform: rotate(90deg); background: rgba(255, 255, 255, 0.2); } /* 左右切换按钮 */ .photo-lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 50px; color: #fff; cursor: pointer; transition: all 0.3s ease; z-index: 10001; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.1); border-radius: 50%; user-select: none; } .photo-lightbox-nav:hover { background: rgba(255, 255, 255, 0.25); transform: translateY(-50%) scale(1.1); } .photo-lightbox-prev { left: 40px; } .photo-lightbox-next { right: 40px; } /* 图片计数器 */ .photo-lightbox-counter { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 16px; background: rgba(0, 0, 0, 0.5); padding: 8px 20px; border-radius: 20px; z-index: 10001; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes zoomIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } } /* 响应式设计 */ @media (max-width: 768px) { .guestbook-btn-container { right: 15px; top: 15px; } .blog-posts-btn-container { right: 15px; top: 90px; } .photo-album-btn-container { right: 15px; top: 165px; } /* 移动端预览面板调整位置,避免超出屏幕 */ .guestbook-preview, .blog-posts-preview, .photo-album-preview { right: auto; left: calc(100% + 10px); transform-origin: center left; transform: translateX(-20px) scale(0.95); } .guestbook-btn-container:hover .guestbook-preview, .blog-posts-btn-container:hover .blog-posts-preview, .photo-album-btn-container:hover .photo-album-preview { transform: translateX(0) scale(1); } .guestbook-content { width: 95%; max-height: 90vh; } .guestbook-body { padding: 0; } .guestbook-form { padding: 15px 20px; } .guestbook-list { padding: 20px; } .guestbook-loading, .guestbook-empty, .load-complete { padding-left: 20px; padding-right: 20px; } /* 移动端表单改为垂直排列 */ .form-row { flex-direction: column; gap: 15px; } }