/* 基础重置 - 保证跨浏览器一致性，减少冗余 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

/* 全局样式 - 简洁背景，适配博客园风格 */
body {
  background-color: #f7f7f7;
  color: #333;
  line-height: 1.7;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* 头部样式 - 简洁导航，加载快 */
.header {
  padding: 24px 0;
  border-bottom: 1px solid #e6e6e6;
  margin-bottom: 24px;
}

.header h1 {
  font-size: 28px;
  color: #222;
  font-weight: 600;
  margin-bottom: 12px;
}

.nav a {
  color: #666;
  text-decoration: none;
  margin-right: 24px;
  font-size: 16px;
}

.nav a:hover {
  color: #0084ff;
  text-decoration: underline;
}

/* 博客列表容器 - 白色背景，轻微阴影，提升可读性 */
.post-list {
  background: #fff;
  padding: 24px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 博客列表项 - 分隔线，间距合理 */
.post-item {
  padding: 16px 0;
  border-bottom: 1px dashed #e6e6e6;
}

.post-item:last-child {
  border-bottom: none;
}

.post-item h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.post-item h2 a {
  color: #0084ff;
  text-decoration: none;
}

.post-item h2 a:hover {
  text-decoration: underline;
}

/* 博客元信息（时间/分类）- 浅灰色，不抢焦点 */
.post-meta {
  color: #999;
  font-size: 14px;
  margin-bottom: 8px;
}

/* 博客摘要 - 控制长度，保持简洁 */
.post-excerpt {
  color: #666;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* 只显示3行 */
  -webkit-box-orient: vertical;
}

/* 博客详情页样式 */
.post-detail {
  background: #fff;
  padding: 32px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.post-detail h1 {
  font-size: 24px;
  margin-bottom: 16px;
  color: #222;
}

.post-content {
  margin-top: 24px;
  font-size: 16px;
  line-height: 1.8;
  color: #333;
}

/* 发布博客表单样式 */
.admin-form {
  background: #fff;
  padding: 32px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  max-width: 800px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0084ff;
}

.form-group textarea {
  min-height: 350px;
  resize: vertical; /* 只允许垂直拉伸 */
}

/* 按钮样式 - 简洁，hover反馈 */
.btn {
  padding: 12px 24px;
  background: #0084ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}

.btn:hover {
  background: #0073e6;
}

/* 提示消息样式 */
.message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 4px;
  display: none;
}

.success {
  background: #e8f5e9;
  color: #2e7d32;
  display: block;
}

.error {
  background: #ffebee;
  color: #c62828;
  display: block;
}

/* 响应式适配 - 移动端优化，保证加载速度 */
@media (max-width: 768px) {
  .header h1 {
    font-size: 24px;
  }
  .post-list, .post-detail, .admin-form {
    padding: 16px;
  }
  .post-item h2 {
    font-size: 18px;
  }
  .form-group textarea {
    min-height: 250px;
  }
}