/* 简语 · 前台样式 */
:root { --bg: #f6f7f9; --surface: #ffffff; --border: #e8eaee; --text: #2b2f36; --text-soft: #7a8290; --primary: #4f6ef7; --primary-soft: #eef1ff; --danger: #e5484d; --danger-soft: #fdecec; --radius: 12px; --shadow: 0 1px 3px rgba(20, 25, 45, 0.05), 0 8px 24px rgba(20, 25, 45, 0.04); --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, "Segoe UI", Roboto, sans-serif; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.7; font-size: 15px; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary); }
.container { width: min(1120px, 94%); margin: 0 auto; }
/* ---------- 顶部导航 ---------- */ .site-header { border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(180%) blur(8px); background: rgba(255, 255, 255, .92); }
.header-inner { display: flex; align-items: center; gap: 28px; height: 62px; }
.logo { font-size: 22px; font-weight: 700; letter-spacing: .5px; color: var(--text); background: linear-gradient(135deg, var(--primary), #8b5cf6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 7px 14px; border-radius: 8px; color: var(--text-soft); font-size: 15px; }
.nav a:hover { color: var(--text); background: var(--bg); }
.nav a.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
/* 登录/管理项：桌面端靠右，样式与 .search-form button 完全一致 */
.nav .nav-auth { margin-left: auto; padding: 0 16px; border: none; border-radius: 8px; background: var(--primary); color: #fff; font-size: 14px; cursor: pointer; line-height: 38px; flex-shrink: 0; text-decoration: none; }
.nav .nav-auth:hover { opacity: .9; color: #fff; background: var(--primary); text-decoration: none; }
.menu-toggle { /* 汉堡菜单：桌面隐藏，移动端显示 */
  display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; padding: 0; flex-shrink: 0; }
.menu-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--text); }
/* ---------- 布局 ---------- */ .layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; padding: 30px 0; flex: 1; align-items: start; }
.content { min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 20px; position: static; top: 84px; }
/* ---------- 文章卡片 ---------- */ .post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px; margin-bottom: 22px; transition: transform .18s ease, box-shadow .18s ease; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(20, 25, 45, .08); }
.post-title { font-size: 21px; font-weight: 700; line-height: 1.4; margin-bottom: 10px; }
.post-title a:hover { color: var(--primary); }
.post-meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: var(--text-soft); font-size: 13px; }
.tag { background: var(--primary-soft); color: var(--primary); padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.post-summary { margin-top: 12px; color: var(--text-soft); font-size: 14px; }
/* ---------- 文章详情 ---------- */ .post-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 40px; margin-bottom: 26px; }
.detail-title { font-size: 28px; font-weight: 700; line-height: 1.35; margin-bottom: 14px; }
.post-body { margin-top: 22px; }
/* ---------- Markdown 正文 ---------- */ .markdown-body { color: #333845; font-size: 15.5px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { margin: 1.4em 0 .6em; line-height: 1.4; color: var(--text); }
.markdown-body h1 { font-size: 24px; }
.markdown-body h2 { font-size: 21px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.markdown-body h3 { font-size: 18px; }
.markdown-body p { margin: .8em 0; }
.markdown-body ul, .markdown-body ol { margin: .8em 0; padding-left: 1.6em; }
.markdown-body li { margin: .3em 0; }
.markdown-body blockquote { margin: 1em 0; padding: 10px 18px; color: var(--text-soft); border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 8px 8px 0; }
.markdown-body code { background: #f0f1f4; padding: 2px 6px; border-radius: 6px; font-size: 13px; font-family: "SF Mono", Consolas, Menlo, monospace; }
.markdown-body pre { background: #1e2530; color: #e6edf3; padding: 18px; border-radius: 10px; overflow-x: auto; margin: 1em 0; }
.markdown-body pre code { background: transparent; color: inherit; padding: 0; }
.markdown-body a { color: var(--primary); }
.markdown-body table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.markdown-body th { background: var(--bg); }
/* ---------- 分页 ---------- */ .pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 8px; }
.pagination a { background: var(--surface); border: 1px solid var(--border); padding: 8px 18px; border-radius: 8px; font-size: 14px; color: var(--text-soft); }
.pagination a:hover { color: var(--primary); border-color: var(--primary); }
.page-info { color: var(--text-soft); font-size: 14px; }
/* ---------- 侧栏小组件 ---------- */ .widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.widget-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; position: relative; padding-left: 12px; }
.widget-title::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 3px; background: linear-gradient(var(--primary), #8b5cf6); }
.widget-list { list-style: none; }
.widget-list li { padding: 7px 0; border-bottom: 1px dashed var(--border); }
.widget-list li:last-child { border-bottom: none; }
.widget-list li a { color: var(--text-soft); font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-list li a:hover { color: var(--primary); padding-left: 4px; }
.widget-list li.cat-row { display: flex; align-items: center; gap: 8px; }
/* 分类项：名称 + 数量，两端对齐 */
.widget-list li.cat-row a { flex: 1; min-width: 0; }
.widget-list .count { flex-shrink: 0; color: var(--text-soft); font-size: 12px; }
.comment-widget li { display: flex; flex-direction: column; gap: 2px; }
.comment-widget .c-name { font-weight: 600; font-size: 13px; color: var(--primary); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comment-widget .c-text { color: var(--text-soft); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-form { display: flex; gap: 8px; }
.search-form input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; background: var(--bg); }
.search-form input:focus { border-color: var(--primary); background: #fff; }
.search-form button { padding: 0 16px; border: none; border-radius: 8px; background: var(--primary); color: #fff; font-size: 14px; cursor: pointer; }
.search-form button:hover { opacity: .9; }
/* ---------- 评论 ---------- */ .comments { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; }
.section-title { font-size: 18px; font-weight: 700; margin-bottom: 18px; }
.notice { background: #fff8e6; color: #8a6d1a; padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.comment-list { list-style: none; }
.comment { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.c-name { font-weight: 600; font-size: 14px; }
.admin-tag { font-size: 11px; background: var(--primary); color: #fff; padding: 1px 7px; border-radius: 10px; margin-left: 6px; vertical-align: 1px; }
.reply-to { color: var(--text-soft); font-size: 12px; margin-left: 6px; }
.reply-btn { margin-left: auto; font-size: 12px; color: var(--text-soft); background: none; border: none; cursor: pointer; font-family: inherit; padding: 2px 8px; border-radius: 6px; }
.reply-btn:hover { color: var(--primary); background: var(--primary-soft); }
.reply-hint { font-size: 12px; color: var(--primary); margin-bottom: 10px; }
.c-time { color: var(--text-soft); font-size: 12px; }
.c-content { color: #444a55; font-size: 14.5px; }
.comment-form { margin-top: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.captcha-row { display: flex; align-items: center; gap: 12px; max-width: calc(50% - 6px); }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-img { height: 42px; width: 120px; flex: 0 0 120px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); background: #fff; }
.comment-form input, .comment-form textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; font-family: inherit; background: var(--bg); resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--primary); background: #fff; }
.comment-form textarea { min-height: 100px; margin-bottom: 12px; }
.btn-primary { display: inline-block; border: none; background: var(--primary); color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 14px; cursor: pointer; font-family: inherit; }
.btn-primary:hover { opacity: .9; color: #fff; }
/* ---------- 页面头 / 空状态 / 404 ---------- */ .page-head { margin-bottom: 22px; }
.page-title { font-size: 26px; font-weight: 700; }
.page-desc { color: var(--text-soft); margin-top: 6px; }
.post-title, .detail-title, .page-title, .widget-title, .post-title a, .widget-title a { overflow-wrap: break-word; word-break: break-word; max-width: 100%; /* 长标题防溢出 */ }
.empty { color: var(--text-soft); text-align: center; padding: 40px 0; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-page { text-align: center; padding: 90px 20px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.err-code { font-size: 72px; font-weight: 800; background: linear-gradient(135deg, var(--primary), #8b5cf6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.empty-page p { color: var(--text-soft); margin: 12px 0 24px; }
.err-actions { margin-top: 6px; display: flex; gap: 12px; justify-content: center; }
.btn-muted { background: var(--text-soft); }
/* ---------- 页脚 ---------- */ .site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 26px 0; text-align: center; color: var(--text-soft); font-size: 13px; }
.site-footer p + p { margin-top: 4px; }
/* ---------- 响应式 ---------- */ .mobile-search { display: none; }
/* 移动端顶部搜索框（桌面隐藏） */
.mobile-search .search-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
@media (max-width: 900px) {
.layout { grid-template-columns: 1fr; }
.sidebar { display: none; }
/* 移动端隐藏整个侧栏，搜索框上移 */
.mobile-search { display: block; margin-bottom: 20px; }
}
@media (max-width: 640px) {
.header-inner { position: relative; justify-content: space-between; gap: 12px; }
.menu-toggle { display: flex; }
.nav { /* 导航改为右侧按钮下拉 */
    order: 3; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-top: none; border-radius: 0 0 12px 12px; box-shadow: 0 12px 24px rgba(20, 25, 45, .08); padding: 8px; display: none; gap: 2px; z-index: 60; }
.nav.open { display: flex; }
.nav a { padding: 11px 14px; border-radius: 8px; font-size: 15px; }
/* 移动端下拉菜单里：登录/管理项变回普通文字链接样式 */
.nav .nav-auth { display: block; margin: 2px 0 0; height: auto; padding: 11px 14px; background: none; color: var(--text-soft); font-weight: 400; justify-content: flex-start; }
.nav .nav-auth:hover { color: var(--text); background: var(--bg); opacity: 1; }
.form-row { grid-template-columns: 1fr; }
.captcha-row { max-width: 100%; }
.post-detail { padding: 24px 20px; }
}
/* ---------- 文章底部原创声明 ---------- */ .post-copyright { margin-top: 28px; padding: 16px 0 4px; border-top: 1px solid var(--border); color: var(--text-soft); font-size: 13px; line-height: 1.9; }
.post-copyright p { margin: 0 0 4px; }
.post-copyright a { color: var(--primary); word-break: break-all; }
.post-copyright a:hover { text-decoration: underline; }
/* ---------- 侧边栏站长信息卡片 ---------- */ .site-intro-widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; overflow: hidden; box-shadow: var(--shadow); }
.site-intro { text-align: center; padding: 28px 20px 18px; }
.site-intro .avatar { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 12px; background: var(--primary-soft); color: var(--primary); font-size: 28px; font-weight: 600; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 3px solid var(--surface); box-shadow: 0 2px 10px rgba(79, 110, 247, .18); }
.site-intro .avatar img { width: 100%; height: 100%; object-fit: cover; }
.site-intro .nickname { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.site-intro .veteran-badge { font-size: 11px; font-weight: 500; color: #b8860b; background: #fff3d6; padding: 2px 8px; border-radius: 10px; line-height: 1.5; white-space: nowrap; }
.site-intro .intro-text { font-size: 13px; color: var(--text-soft); line-height: 1.7; margin: 0 8px 16px; }
.site-intro .stats { display: flex; border-top: 1px solid var(--border); padding: 14px 0 12px; margin: 0 -20px -18px; }
.site-intro .stats .stat { flex: 1; text-align: center; position: relative; }
.site-intro .stats .stat + .stat::before { content: ""; position: absolute; left: 0; top: 20%; height: 60%; width: 1px; background: var(--border); }
.site-intro .stats .num { font-size: 17px; font-weight: 700; color: var(--primary); display: block; line-height: 1.2; }
.site-intro .stats .label { font-size: 12px; color: var(--text-soft); margin-top: 3px; }
/* ---------- 彩虹字 ---------- */ .rainbow-text { background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff, #9b59b6, #ff6b6b); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; animation: rainbow-flow 50s linear infinite; }
@keyframes rainbow-flow { 0% { background-position: 0 0; } 100% { background-position: 300% 0; } }