/* * @File: post_detail.css * @Description: 帖子详情页专用样式文件,实现了内容的清晰排版、评论区美化及响应式适配。 * @Author: Your Name * @Date: 2023-10-27 */ :root { --bs-heading-color: #1a1a1a; --post-detail-sidebar-break: 1200px; } /* 宽屏:左作者卡片 + 居中正文(右侧留空平衡) */ body.page-post-detail .main-container { max-width: none; width: 100%; padding-left: 1rem; padding-right: 1rem; margin-left: auto; margin-right: auto; } .post-detail-shell { display: grid; grid-template-columns: 1fr min(900px, 100%) 1fr; align-items: start; width: 100%; } .post-detail-aside { grid-column: 1; justify-self: end; width: min(268px, 100%); margin-top: 2rem; padding-right: 1.5rem; position: sticky; top: 1.25rem; } /* 作者卡片:玻璃质感 + 纵向对齐,hover 仅上浮不做倾斜 */ .post-author-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 0.7rem; width: 100%; padding: 1.35rem 1.15rem 1.2rem; border-radius: 20px; background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.5); border-top: 1px solid rgba(255, 255, 255, 0.75); border-left: 1px solid rgba(255, 255, 255, 0.75); box-shadow: 0 22px 42px rgba(0, 0, 0, 0.07); font-family: 'Poppins', sans-serif; transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease, background 0.35s ease; overflow: hidden; } .post-author-card__quote { position: absolute; top: 10px; left: 10px; width: 52px; height: 52px; border-radius: 10px; background: rgba(255, 255, 255, 0.1) url(https://s3.cflmy.cn/cflmy/left-quote.png) center / 40px no-repeat; border: 1px solid rgba(255, 255, 255, 0.45); opacity: 0; transition: opacity 0.4s ease; pointer-events: none; } .post-author-card__avatar { align-self: center; position: relative; z-index: 1; padding: 9px; border-radius: 14px; background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.55); border-top: 1px solid rgba(255, 255, 255, 0.75); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08); transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease; } .post-author-card__avatar--link { text-decoration: none; color: inherit; cursor: pointer; } .post-author-card__avatar--link:focus-visible { outline: 2px solid rgba(168, 88, 120, 0.75); outline-offset: 3px; } .post-author-card__avatar img { display: block; width: 88px; height: 88px; border-radius: 10px; object-fit: cover; border: 1px solid rgba(255, 255, 255, 0.45); } .post-author-card__name { margin: 0; padding: 0.15rem 0.25rem 0; text-align: center; font-size: 1.05rem; font-weight: 600; color: #644651; word-break: break-word; transition: color 0.3s ease; } .post-author-card__body { display: flex; flex-direction: column; align-items: center; padding: 0 0.25rem 0.15rem; text-align: center; transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); } .post-author-card__signature { margin: 0; color: #644651; font-size: 0.82rem; line-height: 1.55; } .post-author-card__signature--empty { color: #9a8490; font-style: italic; } .post-author-card:hover { transform: translateY(-7px); background: rgba(255, 255, 255, 0.16); box-shadow: 0 30px 52px rgba(0, 0, 0, 0.11); } .post-author-card:hover .post-author-card__quote { opacity: 0.85; } .post-author-card:hover .post-author-card__avatar { transform: translateY(-5px) scale(1.03); box-shadow: 0 18px 34px rgba(0, 0, 0, 0.11); } .post-author-card:hover .post-author-card__name { color: #4a3340; } .post-author-card:hover .post-author-card__body { transform: translateY(-2px); } .post-author-card:hover .post-author-card__signature { color: #4a3340; } /* --- 1. 页面布局与容器样式 --- */ .main-container { width: 100%; max-width: 900px; margin: 2rem auto; padding: 0 1rem; } body.page-post-detail .main-container { margin-top: 2rem; margin-bottom: 2rem; } .post-detail { grid-column: 2; background-color: rgba(255, 255, 255, 0.2); backdrop-filter: blur(24px); border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.1); border-radius: 30px; padding: 50px 100px; transition: all 0.3s ease; } /* --- 2. 帖子头部元信息(非主体)样式 --- */ .post-detail h2 { font-size: 2rem; font-weight: 700; color: #212529; /* 标题偏深但非纯黑,低于主体优先级 */ margin-bottom: 1.5rem; line-height: 1.4; } /* 详情页顶栏元信息(仅直接子级 p,勿用 :first-of-type,否则会误伤 article) */ .post-detail > p.post-content { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.9rem; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid #e9ecef; } .post-author-profile a { color: #a85878; text-decoration: none; font-weight: 500; } .post-author-profile a:hover { text-decoration: underline; } /* --- 3. 帖子/新闻正文卡片 --- */ article.anlian-rich-content, article.post-content.anlian-rich-content, article.news-content.anlian-rich-content { display: block; margin-bottom: 3rem; background-color: rgba(255, 255, 255, 0.45); padding: 2.2rem; border-radius: 1rem; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06); } /* 主体内图片样式见 rich_content.css */ /* 评论表单由 anlian_forms.css 统一;此处仅保留错误列表 */ .post-detail .error-messages { list-style: none; padding: 0; margin: 0 0 1rem; color: #b33a4d; font-size: 0.875rem; } .post-detail .text-muted a { color: #a85878; font-weight: 500; } .post-detail .anlian-comment-form { margin-bottom: 1.75rem; } /* --- 5. 响应式适配:主体字号同步调整,保持区分度 --- */ @media (max-width: 1199.98px) { .post-detail-aside { display: none; } .post-detail-shell { display: block; } body.page-post-detail .main-container { max-width: 900px; } } @media (max-width: 767.98px) { .main-container { margin: 1rem auto; } .post-detail { padding: 1.5rem; } .post-detail h2 { font-size: 1.75rem; } /* 移动端正文卡片 */ article.anlian-rich-content, article.post-content.anlian-rich-content { padding: 1.5rem; } }