Files

465 lines
19 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.
/* ============ 全局变量:黑白蓝简约风 ============ */
:root {
--primary: #1a73e8;
--primary-dark: #1765cc;
--primary-soft: rgba(26, 115, 232, 0.12);
--text: #202124;
--muted: #5f6368;
--bg: #ffffff;
--surface: #f8f9fa;
--border: #dadce0;
--danger: #d93025;
--success: #188038;
--shadow: 0 1px 2px rgba(60, 64, 67, 0.2), 0 2px 6px rgba(60, 64, 67, 0.1);
--radius: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
background: var(--bg);
color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
/* hidden 属性兜底:防止 .btn 等 display 样式覆盖 hidden 导致按钮常显(如"加载中…" */
[hidden] { display: none !important; }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }
/* ============ 顶栏 ============ */
.topbar {
position: sticky;
top: 0;
z-index: 100;
background: rgba(255, 255, 255, 0.94);
backdrop-filter: blur(8px);
border-bottom: 1px solid var(--border);
}
.topbar-inner {
max-width: 960px;
margin: 0 auto;
padding: 0 16px;
height: 60px;
display: flex;
align-items: center;
gap: 20px;
}
.brand {
font-size: 18px;
font-weight: 600;
color: var(--text);
white-space: nowrap;
}
.nav {
display: flex;
align-items: center;
gap: 4px;
flex: 1;
overflow-x: auto;
}
.nav-link {
color: var(--muted);
padding: 8px 12px;
border-radius: 999px;
font-size: 14px;
white-space: nowrap;
transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); font-weight: 500; }
.auth-area { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
/* ============ 按钮 ============ */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
padding: 9px 18px;
border-radius: 6px;
border: 1px solid transparent;
font-size: 14px;
font-family: inherit;
cursor: pointer;
transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 1px 3px rgba(26, 115, 232, 0.4); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--border); }
.btn-outline:hover { background: var(--surface); }
.btn-text { background: transparent; color: var(--primary); }
.btn-text:hover { background: var(--primary-soft); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 5px; }
.btn-block { width: 100%; }
/* ============ 布局 ============ */
.container { max-width: 960px; margin: 0 auto; padding: 28px 16px 64px; }
.page-title { font-size: 24px; font-weight: 600; margin-bottom: 6px; }
.page-sub { font-size: 14px; margin-bottom: 20px; }
.loading { text-align: center; color: var(--muted); padding: 80px 0; }
.empty-block { text-align: center; padding: 96px 16px; }
.empty-block p:first-child { font-size: 56px; font-weight: 700; color: var(--border); }
.empty-block .btn { margin-top: 20px; }
/* ============ 文章卡片 ============ */
.article-list { display: flex; flex-direction: column; gap: 18px; }
.article-card {
display: block;
background: #fff;
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
color: var(--text);
transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-cover { position: relative; max-height: 260px; overflow: hidden; background: var(--surface); }
.card-cover img { width: 100%; height: 260px; object-fit: cover; display: block; }
.card-cover-empty { height: 96px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--muted); }
.cover-badge {
position: absolute; top: 12px; right: 12px;
background: rgba(32, 33, 36, 0.75); color: #fff;
font-size: 12px; padding: 4px 10px; border-radius: 999px;
}
.card-body { padding: 16px 20px 18px; }
.card-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.card-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; flex-wrap: wrap; }
/* 可见性徽章 */
.badge {
display: inline-block; font-size: 12px; padding: 2px 10px;
border-radius: 999px; border: 1px solid var(--border);
}
.badge-public { color: var(--success); background: rgba(24, 128, 56, 0.08); border-color: rgba(24, 128, 56, 0.3); }
.badge-friend { color: var(--primary); background: var(--primary-soft); border-color: rgba(26, 115, 232, 0.3); }
/* ============ 文章详情 ============ */
.article-detail .article-title { font-size: 30px; line-height: 1.3; margin-bottom: 10px; }
.article-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.article-cover { margin-bottom: 20px; border-radius: var(--radius); overflow: hidden; }
.article-cover img { width: 100%; max-height: 420px; object-fit: cover; display: block; }
.article-content { font-size: 16px; line-height: 1.85; word-break: break-word; }
.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6 { margin: 24px 0 12px; line-height: 1.4; }
.article-content p { margin: 12px 0; }
.article-content img { border-radius: var(--radius); margin: 12px 0; }
.article-content pre {
background: var(--surface); border: 1px solid var(--border);
border-radius: var(--radius); padding: 14px 16px;
overflow-x: auto; font-size: 14px; margin: 16px 0;
}
.article-content code {
background: var(--surface); border: 1px solid var(--border);
padding: 2px 6px; border-radius: 4px;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
font-size: 0.92em;
}
.article-content pre code { background: transparent; border: none; padding: 0; font-size: 14px; }
.article-content blockquote {
border-left: 4px solid var(--border); margin: 16px 0;
padding: 4px 16px; color: var(--muted); background: var(--surface);
border-radius: 0 var(--radius) var(--radius) 0;
}
.article-content ul, .article-content ol { padding-left: 26px; margin: 12px 0; }
.article-content hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.article-content a { text-decoration: underline; }
/* 好友文章锁页 */
.locked-box {
text-align: center; padding: 48px 20px; margin: 24px 0;
background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.locked-box p { margin: 8px 0; }
.locked-box .btn { margin-top: 12px; }
/* ============ 点赞 ============ */
.like-bar {
display: flex; align-items: center; gap: 14px;
padding: 16px 0; margin: 24px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
flex-wrap: wrap;
}
.like-btn { border-radius: 999px; }
.like-btn.liked { background: var(--primary); border-color: var(--primary); color: #fff; }
.like-count { font-weight: 600; }
/* ============ 评论 ============ */
.section-title { font-size: 18px; font-weight: 600; margin: 8px 0 14px; }
.comment-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.comment-item { background: var(--surface); border-radius: var(--radius); padding: 12px 16px; }
.comment-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.comment-form { display: flex; flex-direction: column; gap: 10px; }
.comment-form textarea { resize: vertical; }
.comment-form .btn { align-self: flex-end; }
.comment-hint { display: flex; align-items: center; gap: 10px; margin: 8px 0 24px; }
/* ============ 表单 ============ */
.form label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.form label:first-child { margin-top: 0; }
.form input, .form textarea {
width: 100%; padding: 10px 12px;
border: 1px solid var(--border); border-radius: var(--radius);
font-size: 14px; font-family: inherit; color: var(--text);
outline: none; background: #fff;
transition: border-color 0.15s, box-shadow 0.15s;
}
.form input:focus, .form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form .btn { margin-top: 20px; }
.form-hint { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }
/* 注册表单:验证码输入框与“发送验证码”按钮同行 */
.code-row { display: flex; gap: 8px; margin-top: 6px; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; }
.form-hint a { color: var(--primary); font-weight: 500; }
/* ============ 自定义弹窗 ============ */
.modal-overlay {
position: fixed; inset: 0; z-index: 900;
background: rgba(32, 33, 36, 0.5);
display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
background: #fff; border-radius: var(--radius);
width: min(420px, 100%); max-height: 86vh; overflow-y: auto;
box-shadow: 0 8px 30px rgba(60, 64, 67, 0.3);
animation: modal-in 0.18s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-header {
display: flex; align-items: center; justify-content: space-between;
padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-close {
border: none; background: transparent; color: var(--muted);
font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 50%;
line-height: 1;
}
.modal-close:hover { background: var(--surface); color: var(--text); }
.modal-body { padding: 20px; }
/* ============ 通知(Snackbar,替代 alert ============ */
#toast-root {
position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 8px;
pointer-events: none;
}
.toast {
background: #323232; color: #fff;
padding: 12px 22px; border-radius: 4px; font-size: 14px;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
max-width: 84vw; text-align: center;
opacity: 0; transform: translateY(12px);
transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
/* ============ 用户菜单 ============ */
.user-menu { position: relative; }
.role-badge {
font-size: 12px; background: var(--primary-soft); color: var(--primary);
padding: 2px 8px; border-radius: 999px; margin-left: 4px;
}
.user-dropdown {
position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px;
background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
box-shadow: var(--shadow); overflow: hidden; z-index: 200;
}
.dropdown-item {
display: block; padding: 10px 16px; font-size: 14px; color: var(--text);
cursor: pointer; white-space: nowrap;
}
.dropdown-item:hover { background: var(--surface); }
/* 好友申请管理 */
.app-row {
display: flex; align-items: center; gap: 10px;
padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.app-row:last-child { border-bottom: none; }
.app-user { font-weight: 600; }
.app-email { flex: 1; min-width: 120px; font-size: 13px; }
.app-status { font-size: 13px; }
/* ============ 项目 / 简介 ============ */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.project-card {
border: 1px solid var(--border); border-radius: var(--radius);
padding: 20px; display: flex; flex-direction: column; gap: 10px;
transition: box-shadow 0.2s;
}
.project-card:hover { box-shadow: var(--shadow); }
.project-card h3 { font-size: 17px; }
.project-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
font-size: 12px; color: var(--primary); background: var(--primary-soft);
padding: 2px 10px; border-radius: 999px;
}
.about-card {
display: flex; gap: 24px; align-items: flex-start;
border: 1px solid var(--border); border-radius: var(--radius);
padding: 28px; background: var(--surface);
}
.about-avatar {
width: 88px; height: 88px; flex-shrink: 0;
border-radius: 50%; background: var(--primary); color: #fff;
display: flex; align-items: center; justify-content: center;
font-size: 34px; font-weight: 600;
}
.about-card h2 { font-size: 22px; margin-bottom: 4px; }
.about-bio { margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
/* 主页简介按钮区:编辑简介(博主) + 打赏支持(所有人) */
.about-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
/* 打赏弹窗:二维码卡片 + 感谢文字(点击图片外任意位置关闭) */
.donate-modal {
background: #fff; border-radius: 16px; padding: 26px 30px;
display: flex; flex-direction: column; align-items: center; gap: 14px;
box-shadow: 0 8px 30px rgba(60, 64, 67, 0.3);
animation: modal-in 0.18s ease-out;
}
.donate-modal img { max-width: 260px; width: 100%; height: auto; border-radius: 12px; display: block; }
.donate-thanks { font-size: 15px; color: var(--primary); font-weight: 600; }
.proj-list-title { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
/* ============ 响应式 ============ */
@media (max-width: 720px) {
.topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 8px; }
.nav { order: 3; width: 100%; flex: none; }
.article-detail .article-title { font-size: 24px; }
.about-card { flex-direction: column; align-items: center; text-align: center; }
}
/* ============ 博主发文管理面板 ============ */
.manage-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
align-items: start;
margin-top: 18px;
}
.manage-card {
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 20px;
background: #fff;
}
.cover-field { display: flex; flex-direction: column; gap: 10px; }
.cover-preview { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cover-preview img {
max-height: 200px; border-radius: var(--radius);
border: 1px solid var(--border); background: var(--surface);
}
.cover-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#cover-url { flex: 1; min-width: 200px; }
.radio-row { display: flex; gap: 20px; margin: 6px 0 4px; }
.radio { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.radio input { width: auto; }
.editor-toolbar { display: flex; gap: 8px; margin: 6px 0 10px; flex-wrap: wrap; }
.preview-box {
border: 1px solid var(--border); border-radius: var(--radius);
padding: 14px 18px; margin-bottom: 12px; background: var(--surface);
max-height: 420px; overflow-y: auto;
}
.my-article-row {
display: flex; align-items: center; gap: 12px;
padding: 10px 0; border-bottom: 1px solid var(--border);
}
.my-article-row:last-child { border-bottom: none; }
.my-article-cover { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.my-article-cover-empty { width: 72px; height: 48px; border-radius: 6px; background: var(--surface); flex-shrink: 0; }
.my-article-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.my-article-title { font-weight: 600; color: var(--text); }
.my-article-title:hover { color: var(--primary); }
@media (max-width: 720px) {
.manage-grid { grid-template-columns: 1fr; }
}
/* ============ 评论回复 / 加载更多 / 管理面板补充样式 ============ */
.comment-reply {
margin-left: 28px;
border-left: 3px solid var(--border);
border-radius: 0 var(--radius) var(--radius) 0;
}
.comment-reply-btn { padding: 2px 8px; margin-top: 2px; }
.comment-reply-box { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.comment-input { width: 100%; }
.load-more-btn { margin-top: 18px; }
.modal-actions {
display: flex;
justify-content: flex-end;
gap: 10px;
margin-top: 20px;
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c5221f; }
.btn-danger-text { color: var(--danger); border-color: rgba(217, 48, 37, 0.4); }
.btn-danger-text:hover { background: rgba(217, 48, 37, 0.08); }
.manage-grid-second { margin-top: 20px; }
.manage-card-wide { grid-column: 1 / -1; }
.profile-avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.profile-avatar {
width: 80px; height: 80px; flex-shrink: 0;
border-radius: 50%; overflow: hidden;
background: var(--primary-soft); color: var(--muted);
display: flex; align-items: center; justify-content: center;
font-size: 14px;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
#profile-bio { width: 100%; resize: vertical; }
.about-avatar-img {
width: 88px; height: 88px; flex-shrink: 0;
border-radius: 50%; object-fit: cover;
border: 1px solid var(--border);
}
.my-article-actions { display: flex; gap: 8px; flex-shrink: 0; }
/* ============ 主页简介 / 社交链接 / 视频 / 评论头像 ============ */
.home-about { margin-bottom: 26px; }
.about-main { flex: 1; min-width: 0; }
.social-links { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.social-link {
display: inline-flex; align-items: center; gap: 6px;
padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
background: #fff; color: var(--text); font-size: 13px;
transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.social-link:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow); }
.social-link .social-icon { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
/* 好友列表弹窗 */
.friend-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.friend-row:last-child { border-bottom: none; }
.friend-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.friend-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.article-content video { max-width: 100%; border-radius: 8px; background: #000; display: block; }
.comment-author { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-avatar-empty { background: var(--primary-soft); display: inline-block; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb a { color: var(--primary); }
.project-detail-tags { margin: 12px 0; }
.project-detail-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.publish-title { font-size: 14px; color: var(--text); margin-bottom: 4px; }