/* 博客页面样式 - 简洁现代 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
  background: #f5f6f8;
  color: #1f2329;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; outline: none; }

/* 顶部导航 */
.blog-nav {
  background: #fff;
  border-bottom: 1px solid #e8eaee;
  position: sticky; top: 0; z-index: 50;
}
.blog-nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  height: 56px; display: flex; align-items: center; gap: 18px;
}
.nav-logo { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: #1677ff; }
.nav-logo .logo-mark {
  width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg,#1677ff,#36a3ff);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700;
}
.nav-link { font-size: 14px; color: #4e5969; padding: 6px 4px; position: relative; }
.nav-link.on { color: #1677ff; font-weight: 600; }
.nav-link.on::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: -2px; height: 2px; background: #1677ff; border-radius: 2px; }
.nav-spacer { flex: 1; }
.nav-user { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #4e5969; }
.nav-user img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.nav-btn {
  font-size: 13px; color: #4e5969; border: 1px solid #d6d9de; border-radius: 6px;
  padding: 5px 12px; transition: all .15s;
}
.nav-btn:hover { color: #1677ff; border-color: #1677ff; }
.nav-btn.primary { color: #fff; background: #1677ff; border-color: #1677ff; }
.nav-btn.primary:hover { background: #3c8cff; }

/* 主体 */
.blog-main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }

/* 列表头部 */
.blog-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.blog-title { font-size: 24px; font-weight: 700; }
.blog-sub { font-size: 13px; color: #86909c; }
.blog-search {
  flex: 1; min-width: 180px; display: flex; gap: 8px; justify-content: flex-end;
}
.blog-search input {
  flex: 1; max-width: 280px; border: 1px solid #e5e6eb; border-radius: 8px; padding: 8px 12px; font-size: 14px;
  transition: border .15s;
}
.blog-search input:focus { border-color: #1677ff; }
.blog-search button {
  background: #1677ff; color: #fff; border-radius: 8px; padding: 8px 16px; font-size: 14px;
}
.blog-search button:hover { background: #3c8cff; }

/* 文章卡片 */
.post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px;
}
.post-card {
  background: #fff; border-radius: 12px; border: 1px solid #eef0f3; padding: 18px;
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(31,35,41,.08); }
.post-card h3 { font-size: 16px; font-weight: 600; line-height: 1.5; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card p.summary { font-size: 13px; color: #86909c; line-height: 1.6; margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #86909c; white-space: nowrap; }
.post-meta img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.post-meta .meta-author { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.post-meta .meta-date { color: #a9aeb8; flex-shrink: 0; }
.post-meta .meta-stat { flex-shrink: 0; }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: #c9cdd4; flex-shrink: 0; }
.post-meta .sp { flex: 1; }
.post-empty { text-align: center; padding: 80px 0; color: #86909c; font-size: 14px; }

/* 分页 */
.pager { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.pager button {
  min-width: 34px; height: 34px; border-radius: 8px; border: 1px solid #e5e6eb; background: #fff;
  font-size: 13px; color: #4e5969; padding: 0 10px;
}
.pager button:hover:not(:disabled) { border-color: #1677ff; color: #1677ff; }
.pager button.on { background: #1677ff; color: #fff; border-color: #1677ff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* 文章详情 */
.post-detail { background: #fff; border-radius: 12px; border: 1px solid #eef0f3; padding: 28px; max-width: 860px; margin: 0 auto; }
.post-detail h1 { font-size: 24px; font-weight: 700; line-height: 1.5; margin-bottom: 14px; }
.detail-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #86909c; padding-bottom: 18px; border-bottom: 1px solid #f2f3f5; margin-bottom: 20px; }
.detail-meta img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.detail-content { font-size: 15px; line-height: 1.9; color: #1f2329; word-break: break-word; overflow-wrap: break-word; overflow: hidden; }
.detail-content img { max-width: 100%; height: auto !important; border-radius: 8px; display: block; margin: 12px auto; }
.detail-content video, .detail-content iframe { max-width: 100%; display: block; margin: 12px auto; border-radius: 8px; }
.detail-content pre, .detail-content code { max-width: 100%; overflow-x: auto; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #1677ff; margin-bottom: 16px; }

/* 评论区 */
.comment-sec { max-width: 860px; margin: 20px auto 0; }
.comment-sec h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.comment-form { background: #fff; border-radius: 12px; border: 1px solid #eef0f3; padding: 16px; display: flex; gap: 12px; margin-bottom: 16px; }
.comment-form textarea {
  flex: 1; border: 1px solid #e5e6eb; border-radius: 8px; padding: 10px 12px; font-size: 14px;
  min-height: 70px; resize: vertical;
}
.comment-form textarea:focus { border-color: #1677ff; }
.comment-form button {
  align-self: flex-end; background: #1677ff; color: #fff; border-radius: 8px; padding: 8px 18px; font-size: 14px; white-space: nowrap;
}
.comment-form button:hover { background: #3c8cff; }
.comment-item { display: flex; gap: 12px; background: #fff; border-radius: 12px; border: 1px solid #eef0f3; padding: 14px 16px; margin-bottom: 12px; }
.comment-item img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-item .c-body { flex: 1; min-width: 0; }
.comment-item .c-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.comment-item .c-time { font-size: 12px; color: #c9cdd4; font-weight: 400; }
.comment-item .c-text { font-size: 14px; line-height: 1.7; color: #4e5969; word-break: break-word; }
.comment-empty { text-align: center; color: #86909c; font-size: 13px; padding: 24px 0; }
.login-tip { text-align: center; color: #86909c; font-size: 13px; padding: 10px 0; }
.login-tip a { color: #1677ff; }

/* 弹窗 */
.dlg-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: center; justify-content: center; }
.dlg-mask.hidden { display: none; }
.dlg { background: #fff; border-radius: 14px; width: 520px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.15); overflow: hidden; }
.dlg.dlg-wide { width: 720px; max-width: 94vw; }
.dlg-head { padding: 18px 22px; border-bottom: 1px solid #f2f3f5; display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 600; }
.dlg-close { font-size: 20px; color: #86909c; width: 28px; height: 28px; border-radius: 6px; }
.dlg-close:hover { background: #f2f3f5; color: #1f2329; }
.dlg-body { padding: 20px 22px; }
.dlg-body input, .dlg-body textarea {
  width: 100%; box-sizing: border-box; border: 1px solid #e5e6eb; border-radius: 8px; padding: 10px 12px; font-size: 14px; outline: none; background: #fff;
}
.dlg-body input:focus, .dlg-body textarea:focus { border-color: #1677ff; }
.dlg-field { margin-bottom: 14px; }
.dlg-field label { display: block; font-size: 13px; color: #4e5969; margin-bottom: 6px; }
.dlg-foot { padding: 0 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }
.btn-ghost { border: 1px solid #d6d9de; border-radius: 8px; padding: 8px 18px; font-size: 14px; color: #4e5969; }
.btn-ghost:hover { color: #1677ff; border-color: #1677ff; }
.btn-primary { background: #1677ff; color: #fff; border-radius: 8px; padding: 8px 20px; font-size: 14px; }
.btn-primary:hover { background: #3c8cff; }

/* toast */
#blogToast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px;
  opacity: 0; transition: opacity .2s; pointer-events: none; }
#blogToast.show { opacity: 1; }
#blogToast.ok { background: #23a74f; }
#blogToast.err { background: #e64545; }

/* 富文本编辑器 */
.editor-wrap { border: 1px solid #e5e6eb; border-radius: 8px; overflow: hidden; }
.editor-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; padding: 6px 8px;
  background: #fafbfc; border-bottom: 1px solid #eef0f3; overflow-x: auto; }
.editor-toolbar button { min-width: 30px; height: 28px; padding: 0 8px; border-radius: 5px;
  font-size: 13px; color: #4e5969; background: transparent; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.editor-toolbar button:hover { background: #eef0f3; color: #1f2329; }
.editor-toolbar select { height: 28px; border: 1px solid #e5e6eb; border-radius: 5px; font-size: 12px; color: #4e5969; background: #fff; padding: 0 4px; outline: none; flex-shrink: 0; }
.editor-toolbar input[type=color] { width: 30px; height: 26px; border: none; background: none; padding: 0; cursor: pointer; flex-shrink: 0; }
.tb-sep { width: 1px; height: 18px; background: #e5e6eb; margin: 0 4px; flex-shrink: 0; }
/* 发布弹窗分类下拉(同行小尺寸, 与工具栏无关) */
.pub-cat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pub-cat-row label { font-size: 13px; color: #4e5969; white-space: nowrap; }
.pub-cat-row select { height: 32px; border: 1px solid #e5e6eb; border-radius: 8px; padding: 0 10px; font-size: 14px; outline: none; background: #fff; min-width: 140px; }
.pub-cat-row select:focus { border-color: #1677ff; }
.editor { min-height: 240px; max-height: 420px; overflow-y: auto; padding: 12px 14px; font-size: 14px;
  line-height: 1.8; outline: none; }
.editor:empty::before { content: attr(placeholder); color: #c0c4cc; pointer-events: none; }
.editor img { max-width: 100%; border-radius: 6px; }
.hidden { display: none !important; }

/* 文章详情编辑按钮 */
.edit-btn { border: 1px solid #1677ff; color: #1677ff; background: #f0f6ff; border-radius: 6px;
  font-size: 12px; padding: 4px 12px; cursor: pointer; transition: all .15s; }
.edit-btn:hover { background: #1677ff; color: #fff; }

/* 验证码 */
.captcha-row{display:flex;align-items:center;gap:10px}
.captcha-row input{flex:1;min-width:0}
.captcha-tip{font-size:12.5px;color:#ff9800;background:#fff7e6;border:1px solid #ffe7ba;border-radius:6px;padding:4px 10px;white-space:nowrap}
/* 验证码换一张 */
.captcha-refresh{font-size:12.5px;color:#2b6ff2;cursor:pointer;white-space:nowrap;user-select:none}
.captcha-refresh:hover{text-decoration:underline}
.comment-captcha{display:flex;align-items:center;gap:10px;margin:10px 0}
.comment-captcha input{width:130px;padding:8px 10px;border:1px solid #e0e3e8;border-radius:6px;font-size:14px}