/* 前台样式：首页 / 列表页 / 内容页（浅色博客风） */
:root {
  --f-bg: #F7F8FA;
  --f-surface: #FFFFFF;
  --f-text: #1F2937;
  --f-text-sub: #4B5563;
  --f-muted: #9CA3AF;
  --f-accent: #0052D9;
  --f-border: #E5E7EB;
  --f-radius: 10px;
  --f-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--f-text);
  background: var(--f-bg);
}
a { color: var(--f-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* 头部 */
.site-header {
  background: var(--f-surface);
  border-bottom: 1px solid var(--f-border);
  box-shadow: var(--f-shadow);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
}
.site-brand { display: flex; align-items: baseline; gap: 10px; color: inherit; }
.site-brand:hover { text-decoration: none; }
.site-title { font-size: 20px; font-weight: 700; color: var(--f-text); }
.site-subtitle { font-size: 13px; color: var(--f-muted); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav-link {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--f-text-sub);
  font-size: 14px;
}
.site-nav-link:hover { background: var(--f-bg); color: var(--f-accent); text-decoration: none; }

/* 主区 */
.site-main { padding: 28px 20px 48px; }
.page-head { margin-bottom: 22px; }
.page-head-title { margin: 0 0 6px; font-size: 26px; font-weight: 700; }
.page-head-desc { margin: 0; color: var(--f-text-sub); font-size: 14px; }
.section-title { margin: 0 0 14px; font-size: 17px; font-weight: 600; }

/* 文章列表 */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.post-card {
  background: var(--f-surface);
  border: 1px solid var(--f-border);
  border-radius: var(--f-radius);
  padding: 18px 20px;
  box-shadow: var(--f-shadow);
}
.post-card-title { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.4; }
.post-card-title a { color: var(--f-text); }
.post-card-title a:hover { color: var(--f-accent); text-decoration: none; }
.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--f-muted);
  margin-bottom: 8px;
}
.meta-link { color: var(--f-accent); }
.meta-plain { color: var(--f-muted); }
.post-card-summary { margin: 0; color: var(--f-text-sub); font-size: 14px; }

/* 内容页 */
.post-article {
  background: var(--f-surface);
  border: 1px solid var(--f-border);
  border-radius: var(--f-radius);
  padding: 28px 30px;
  box-shadow: var(--f-shadow);
}
.post-title { margin: 0 0 10px; font-size: 28px; font-weight: 700; line-height: 1.35; }
.post-content { margin: 18px 0; font-size: 15px; color: var(--f-text); }
.post-content img { max-width: 100%; height: auto; border-radius: 8px; }
.post-content pre {
  background: #0F172A;
  color: #E2E8F0;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
}
.post-content code { font-family: Consolas, Monaco, monospace; }
.post-content blockquote {
  margin: 14px 0;
  padding: 8px 16px;
  border-left: 3px solid var(--f-accent);
  background: var(--f-bg);
  color: var(--f-text-sub);
}

/* 标签 */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tag-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: #EFF6FF;
  color: var(--f-accent);
  font-size: 12px;
}

/* 上下篇 */
.post-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 0 6px;
  padding-top: 16px;
  border-top: 1px solid var(--f-border);
}
.pager-link { font-size: 14px; color: var(--f-text-sub); }
.pager-link:hover { color: var(--f-accent); text-decoration: none; }
.pager-next { margin-left: auto; text-align: right; }

/* 评论（简洁卡片式布局） */
.comments { margin-top: 26px; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.comment-card {
  background: var(--f-surface);
  border: 1px solid var(--f-border);
  border-radius: var(--f-radius);
  padding: 14px 16px;
  box-shadow: var(--f-shadow);
}
.comment-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-card-head .reply-btn { margin-left: auto; }
.comment-avatar {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--f-accent);
  color: #fff;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.comment-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.comment-name { font-size: 14px; color: var(--f-text); font-weight: 600; }
.comment-time { font-size: 12px; color: var(--f-muted); }
.comment-body { margin: 0; font-size: 14px; color: var(--f-text-sub); }
.comment-replies {
  list-style: none;
  margin: 12px 0 0;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--f-border);
  display: grid;
  gap: 10px;
}
.comments-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--f-muted);
  background: var(--f-surface);
  border: 1px dashed var(--f-border);
  border-radius: var(--f-radius);
  font-size: 14px;
}

/* 友链 */
.friend-links { margin-top: 34px; }
.friend-links-row { display: flex; flex-wrap: wrap; gap: 10px; }
.friend-link {
  padding: 6px 14px;
  background: var(--f-surface);
  border: 1px solid var(--f-border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--f-text-sub);
}
.friend-link:hover { color: var(--f-accent); border-color: var(--f-accent); text-decoration: none; }

/* 空态 / 404 */
.empty {
  background: var(--f-surface);
  border: 1px dashed var(--f-border);
  border-radius: var(--f-radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--f-muted);
}
.notfound-code { margin: 0 0 8px; font-size: 48px; font-weight: 700; color: var(--f-border); }

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--f-border);
  padding: 18px 0;
  background: var(--f-surface);
}
.site-footer p { margin: 0; font-size: 13px; color: var(--f-muted); text-align: center; }

/* 头部用户区（登录态 / 登录注册入口） */
.site-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.site-user-name { color: var(--f-text-sub); font-weight: 600; }
.site-user-form { display: inline; margin: 0; }
.site-user-link {
  border: 0; background: none; padding: 0;
  color: var(--f-accent); font-size: 13px; cursor: pointer;
}
.site-user-link:hover { text-decoration: underline; }

/* Flash 提示 */
.flash {
  margin-bottom: 18px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
}
.flash-success { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.flash-error   { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }

/* 表单控件（登录 / 注册 / 评论） */
.field { margin-bottom: 14px; }
.field-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--f-text-sub); }
.input, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--f-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--f-text);
  background: var(--f-surface);
  min-width: 0;
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--f-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
.textarea { resize: vertical; line-height: 1.6; }

.btn-accent {
  display: inline-block;
  padding: 9px 22px;
  border: 0;
  border-radius: 8px;
  background: var(--f-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-accent:hover { background: #2563EB; }
.btn-block { width: 100%; }

/* 登录 / 注册卡片 */
.auth-card {
  max-width: 420px;
  margin: 26px auto 10px;
  background: var(--f-surface);
  border: 1px solid var(--f-border);
  border-radius: var(--f-radius);
  padding: 30px 32px;
  box-shadow: var(--f-shadow);
}
.auth-title { margin: 0 0 6px; font-size: 24px; font-weight: 700; }
.auth-sub { margin: 0 0 18px; color: var(--f-muted); font-size: 13px; }
.auth-error {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
  font-size: 13px;
}
.auth-error-hint { display: block; margin-top: 4px; color: #DC2626; }
.auth-form .btn-block { margin-top: 6px; }
.auth-switch { margin: 16px 0 0; font-size: 13px; color: var(--f-muted); text-align: center; }

/* 注册邮箱验证码 */
.email-code-row { display: flex; gap: 10px; align-items: center; }
.email-code-row .input { flex: 1; min-width: 0; }
.email-code-btn {
  flex: 0 0 auto; padding: 9px 14px;
  font-size: 13px; white-space: nowrap;
}
.email-code-btn:disabled { background: #B5C7F0; cursor: not-allowed; }

/* 评论表单（卡片） */
.comment-form-card {
  margin-top: 18px;
  background: var(--f-surface);
  border: 1px solid var(--f-border);
  border-radius: var(--f-radius);
  padding: 16px;
  box-shadow: var(--f-shadow);
}
.comment-form { display: grid; gap: 10px; }
.comment-form-head { display: flex; align-items: center; gap: 10px; }
.comment-avatar-self { background: var(--f-text-sub); }
.comment-form-as { font-size: 14px; color: var(--f-text-sub); font-weight: 500; }
.comment-form .textarea { min-height: 96px; }
.comment-form-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.comment-form-foot .btn-accent { margin-left: auto; }

/* 评论验证码 */
.captcha-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.captcha-img {
  width: 132px; height: 44px;
  border: 1px solid var(--f-border); border-radius: 6px;
  cursor: pointer; background: #F2F4F7;
  vertical-align: middle;
}
.captcha-input { width: 120px; text-transform: uppercase; letter-spacing: 2px; }
.captcha-tip { font-size: 12px; color: var(--f-muted); }
.comment-reply-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #EFF6FF;
  border-radius: 8px;
  font-size: 13px;
  color: var(--f-text-sub);
}

/* 未登录提示卡片 */
.comment-login-card {
  margin-top: 18px;
  padding: 26px 20px;
  text-align: center;
  background: var(--f-surface);
  border: 1px dashed var(--f-border);
  border-radius: var(--f-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.comment-login-icon { color: var(--f-accent); }
.comment-login-hint { margin: 0; font-size: 14px; color: var(--f-text-sub); }
.comment-login-actions { display: flex; gap: 10px; }
.btn-ghost {
  display: inline-block;
  padding: 9px 22px;
  border: 1px solid var(--f-border);
  border-radius: 8px;
  background: var(--f-surface);
  color: var(--f-text-sub);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--f-accent); color: var(--f-accent); text-decoration: none; }
.reply-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--f-accent);
  font-size: 12px;
  cursor: pointer;
}
.reply-btn:hover { text-decoration: underline; }

/* 头部搜索框 */
.site-search { display: flex; align-items: center; gap: 6px; }
.site-search-input {
  width: 180px;
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid var(--f-border);
  border-radius: 999px;
  font-size: 13px;
  font-family: inherit;
  color: var(--f-text);
  background: var(--f-bg);
}
.site-search-input:focus {
  outline: none;
  border-color: var(--f-accent);
  background: var(--f-surface);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
.site-search-btn {
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--f-accent);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.site-search-btn:hover { background: #2563EB; }

/* 关于本站 */
.about-content {
  background: var(--f-surface);
  border: 1px solid var(--f-border);
  border-radius: var(--f-radius);
  padding: 28px 30px;
  box-shadow: var(--f-shadow);
  font-size: 15px;
  color: var(--f-text);
}
.about-content p { margin: 0 0 12px; }
.about-content img { max-width: 100%; height: auto; border-radius: 8px; }

/* 点赞 */
.post-actions { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; }
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--f-border);
  border-radius: 999px;
  background: var(--f-surface);
  color: var(--f-text-sub);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.like-btn:hover { border-color: var(--f-accent); color: var(--f-accent); }
.like-btn.is-liked { border-color: #E11D48; color: #E11D48; background: #FFF1F2; }
.like-icon { display: inline-block; }
.like-count { font-weight: 600; }
.like-msg { font-size: 13px; color: var(--f-muted); }

@media (max-width: 640px) {
  .page-head-title { font-size: 22px; }
  .post-title { font-size: 22px; }
  .post-article { padding: 20px 16px; }
}
