/* ------------------------------------
 * Typecho Default Theme - 清新简洁风格
 *
 * @author  Typecho Team
 * @link    http://typecho.org/
 * @update  2025-08-20
 * 风格特点: 留白充足、色彩轻盈、层次清晰、阅读友好
 * --------------------------------- */

/* ------------------
 * 全局基础样式
 * --------------- */
body {
  background-color: #f9fafb; /* 浅灰背景，替代纯白更柔和 */
  color: #374151; /* 深灰文字，比纯黑更易读 */
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft Yahei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px; /* 基础字体放大，提升可读性 */
  line-height: 1.7; /* 宽松行高，适合长文本阅读 */
  margin: 0 auto;
  max-width: 1200px; /* 限制最大宽度，避免宽屏显示过宽 */
  padding: 0 20px;
}

a {
  color: #3b82f6; /* 清新蓝色作为主色调 */
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover, a:active {
  color: #1d4ed8; /* 加深hover颜色 */
}

/* 代码块样式优化 */
pre, code { 
  background: #f3f4f6;
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 0.9em;
}
code { 
  padding: 2px 5px; 
  color: #dc2626;
  border-radius: 3px;
}
pre {
  padding: 15px;
  overflow: auto;
  max-height: 400px;
  border-radius: 6px;
  margin: 1.5em 0;
  border-left: 3px solid #3b82f6; /* 左侧蓝色标记 */
}
pre code {
  padding: 0;
  color: #374151;
}

/* 引用样式 */
blockquote {
  margin: 1.5em 0;
  padding: 15px 20px;
  border-left: 3px solid #94a3b8; /* 浅灰蓝色引用线 */
  color: #64748b;
  background: #f1f5f9;
  border-radius: 0 4px 4px 0;
  font-style: italic;
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  border-radius: 6px;
  overflow: hidden; /* 配合圆角 */
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
table th,
table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e2e8f0;
}
table th {
  background: #f1f5f9;
  font-weight: 600;
  text-align: left;
}
table tr:last-child td {
  border-bottom: none;
}
table tr:hover td {
  background: #f8fafc; /* 行hover效果 */
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  color: #1e293b;
  margin-top: 1.8em;
  margin-bottom: 0.8em;
  line-height: 1.3;
}
h1 { font-size: 1.8em; }
h2 { font-size: 1.5em; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.5em; }
h3 { font-size: 1.3em; }
h4 { font-size: 1.1em; }

/* 表单元素 */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  width: 100%;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 0.95em;
  transition: all 0.2s ease;
  background: #fff;
}
input:focus, textarea:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); /* 聚焦光晕 */
}
textarea {
  resize: vertical;
  min-height: 120px;
}


/* 特殊链接样式 */
.post-meta a,
.post-content a,
.widget a,
.comment-content a {
  border-bottom: 1px solid #bfdbfe;
  padding-bottom: 1px;
}
.post-meta a:hover,
.post-content a:hover,
.widget a:hover,
.comment-content a:hover {
  border-bottom-color: #3b82f6;
}

/* ------------------
 * 页头样式
 * --------------- */
#header {
  padding: 40px 0 25px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 30px;
  text-align: center; /* 标题居中更清新 */
}

#logo {
  color: #1e293b;
  font-size: 2.2em;
  font-weight: 700;
  transition: color 0.3s ease;
  margin: 0;
}
#logo:hover {
  color: #3b82f6;
}
#logo img {
  max-height: 60px; /* 调整Logo最大高度，更紧凑 */
  width: auto; /* 保持宽高比 */
  margin: 0 auto; /* 居中显示 */
}

.description {
  margin: 10px 0 0;
  color: #64748b;
  font-style: normal; /* 取消斜体更简洁 */
  font-size: 1em;
}

/* 导航菜单 */
#nav-menu {
  margin: 30px 0 0;
  padding: 0;
  display: flex;
  justify-content: center; /* 菜单居中 */
  flex-wrap: wrap;
}
#nav-menu a {
  display: block;
  padding: 8px 18px;
  margin: 0 5px 8px; /* 增加间距 */
  color: #475569;
  border: 1px solid transparent; /* 透明边框占位 */
  border-radius: 4px; /* 圆角菜单 */
  font-size: 0.95em;
  transition: all 0.2s ease;
}
#nav-menu a:hover,
#nav-menu .current {
  background: #eff6ff;
  color: #3b82f6;
  border-color: #dbeafe;
}

/* 搜索框 - 重点修正 */
#search {
  position: relative;
  margin-top: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
#search input {
  padding: 10px 40px 10px 15px; /* 右侧预留足够空间给图标 */
  border-color: #e2e8f0;
}
#search button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%); /* 垂直居中 */
  border: none;
  width: 20px;
  height: 20px;
  background: transparent url(img/icon-search.png) no-repeat center center;
  background-size: 20px;
  cursor: pointer;
  text-indent: -9999em; /* 彻底隐藏按钮文字，只留图标 */
  overflow: hidden; /* 确保文字不溢出 */
}

@media 
(-webkit-min-device-pixel-ratio: 2), 
(min-resolution: 192dpi) {
  #search button {
    background-image: url(img/icon-search@2x.png);
  }
}


/* ------------------
 * 主内容区
 * --------------- */

/* 文章卡片样式 */
.post {
  background: #fff;
  padding: 30px;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none; /* 去除原边框 */
}
.post:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px rgba(0,0,0,0.05);
}

/* 文章标题 */
.post-title {
  margin: 0 0 15px;
  font-size: 1.8em;
}
.post-title a {
  color: #1e293b;
  border-bottom: none;
}
.post-title a:hover {
  color: #3b82f6;
}

/* 文章元数据 */
.post-meta {
  margin: 0 0 20px;
  padding: 0;
  color: #64748b;
  font-size: 0.9em;
  display: flex;
  flex-wrap: wrap;
  gap: 15px; /* 分散标签 */
}
.post-meta li {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: none;
}
.post-meta li:before {
  content: "•";
  margin-right: 8px;
  color: #cbd5e1;
}
.post-meta li:first-child:before {
  display: none; /* 第一个标签无前缀 */
}

/* 文章内容区（重点优化内容页） */
.post-content {
  line-height: 1.8;
  color: #374151;
  font-size: 1.05em;
}
.post-content p {
  margin: 0 0 1.5em; /* 段落间距 */
}
.post-content img, .comment-content img,
.post-content video, .comment-content video {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5em auto; /* 图片上下居中并增加间距 */
  display: block;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.post-content h2 {
  margin-top: 2em;
  margin-bottom: 1em;
}
.post-content ul, .post-content ol {
  margin: 0 0 1.5em 1.5em;
  padding: 0;
}
.post-content li {
  margin-bottom: 0.5em;
}
.post-content hr {
  margin: 2.5em auto;
  width: 80px;
  border: none;
  border-top: 2px solid #e2e8f0;
}

/* 标签样式 */
.post .tags {
  clear: both;
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px dashed #e2e8f0;
}
.post .tags a {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 8px;
  padding: 4px 10px;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 12px; /* 圆形标签 */
  font-size: 0.85em;
  border-bottom: none;
}
.post .tags a:hover {
  background: #dbeafe;
  color: #3b82f6;
}

/* 上一篇/下一篇 */
.post-near {
  list-style: none;
  margin: 30px 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}
.post-near li {
  margin: 0;
  flex: 1;
  min-width: 250px;
}
.post-near a {
  display: block;
  padding: 12px 15px;
  background: #f8fafc;
  border-radius: 6px;
  border-bottom: none;
}
.post-near a:hover {
  background: #eff6ff;
}

/* 列表页标题 */
.archive-title {
  margin: 0 0 30px;
  padding: 12px 20px;
  color: #1e293b;
  font-size: 1.3em;
  font-weight: 600;
  background: #f1f5f9;
  border-radius: 6px;
  border-left: 4px solid #3b82f6;
}

/* 加载更多按钮 */
.more {
  text-align: center;
  margin: 40px 0;
}
.more a {
  display: inline-block;
  padding: 10px 20px;
  background: #3b82f6;
  color: white;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s ease;
  border-bottom: none;
}
.more a:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

/* 分页样式 */
.page-navigator {
  list-style: none;
  margin: 40px 0;
  padding: 0;
  text-align: center;
}
.page-navigator li {
  display: inline-block;
  margin: 0 4px;
}
.page-navigator a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 4px;
  color: #64748b;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}
.page-navigator a:hover {
  background: #f8fafc;
  color: #3b82f6;
  border-color: #dbeafe;
}
.page-navigator .current a {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
  font-weight: 500;
}


/* ------------------
 * 评论区
 * --------------- */
#comments {
  padding-top: 20px;
  margin-top: 30px;
  border-top: 1px solid #e2e8f0;
}
.comment-list, .comment-list ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.comment-list li {
  padding: 20px;
  margin-top: 15px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: box-shadow 0.2s ease;
}
.comment-list li:hover {
  box-shadow: 0 4px 6px rgba(0,0,0,0.03);
}
.comment-list li.comment-level-odd {
  background: #f8fafc;
}
.comment-list li.comment-by-author {
  background: #f0f9ff;
  border-color: #93c5fd;
}
.comment-list li .comment-reply {
  text-align: right;
  font-size: 0.9em;
  margin-top: 10px;
}
.comment-meta {
  margin-bottom: 10px;
}
.comment-meta a {
  color: #64748b;
  font-size: 0.9em;
}
.comment-author {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 500;
}
.comment-author .avatar {
  width: 36px;
  height: 36px;
  float: left;
  margin-right: 10px;
  border-radius: 50%;
  border: 2px solid #f1f5f9;
}
.comment-content {
  font-size: 0.95em;
  line-height: 1.7;
}

/* 评论回复框 */
.comment-list .respond {
  margin-top: 15px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 15px;
}
.respond .cancel-comment-reply {
  float: right;
  margin-top: 15px;
  font-size: 0.9em;
}
#comment-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #475569;
}
#comment-form .required:after {
  content: " *";
  color: #ef4444;
}
#comment-form .submit {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s ease;
}
#comment-form .submit:hover {
  background: #1d4ed8;
}


/* ------------------
 * 侧边栏
 * --------------- */
#secondary {
  padding-top: 30px; /* 与主内容区对齐 */
  word-wrap: break-word;
}
.widget {
  margin-bottom: 30px;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.widget-title {
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 15px;
  font-size: 1.1em;
  color: #1e293b;
  font-weight: 600;
}
.widget-list {
  list-style: none;
  padding: 0;
}
.widget-list li {
  margin: 0;
  line-height: 1.7;
  padding: 8px 0;
  border-bottom: 1px dashed #f1f5f9;
}
.widget-list li:last-child {
  border-bottom: none;
}
.widget-list li a {
  color: #475569;
  border-bottom: none;
}
.widget-list li a:hover {
  color: #3b82f6;
  padding-left: 5px;
}


/* ------------------
 * 页脚
 * --------------- */
#footer {
  padding: 40px 0;
  line-height: 1.8;
  text-align: center;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
  margin-top: 50px;
  font-size: 0.9em;
}
#footer a {
  color: #64748b;
  border-bottom: 1px solid #cbd5e1;
}
#footer a:hover {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}


/* -----------------
 * 错误页面
 * -------------- */
.error-page {
  margin: 80px 0;
  text-align: center;
  padding: 40px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.error-page h2 {
  font-size: 2em;
  color: #ef4444;
  margin-bottom: 20px;
  border-bottom: none;
}
.error-page p {
  font-size: 1.1em;
  color: #64748b;
}


/* -----------------
 * 图片对齐
 *--------------- */
.aligncenter, div.aligncenter {
  display: block;
  margin: 1.5em auto;
}
.alignleft {
  float: left;
}
.alignright {
  float: right;
}
img.alignleft {
  margin: 0 20px 20px 0;
}
img.alignright {
  margin: 0 0 20px 20px;
}


/* -----------------
 * 响应式调整
 *--------------- */
@media (max-width: 767px) {
  body {
    font-size: 15px;
    padding: 0 15px;
  }
  
  #header {
    padding: 30px 0 20px;
  }
  
  #nav-menu a {
    padding: 6px 12px;
    font-size: 0.9em;
  }
  
  .post {
    padding: 20px 15px;
  }
  
  .post-title {
    font-size: 1.5em;
  }
  
  .post-content {
    font-size: 1em;
  }
  
  .archive-title {
    padding: 10px 15px;
    font-size: 1.2em;
  }
  
  .page-navigator a {
    padding: 6px 10px;
    font-size: 0.9em;
  }
  
  #secondary {
    padding-top: 15px;
  }
  
  .widget {
    padding: 15px;
  }
}

@media (max-width: 768px) {
  #header, .post-title, .post-meta {
    text-align: center;
  }
  
  .post-meta {
    justify-content: center;
  }
  
  .archive-title {
    text-align: center;
    border-left: none;
    border-top: 4px solid #3b82f6;
    border-radius: 6px 6px 0 0;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1140px; /* 稍宽一点的容器 */
  }
}


/* 辅助样式 */
.hidden {
  display: none !important;
  visibility: hidden;
}
.sr-only {
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}
.sr-only.focusable:active,
.sr-only.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
}
.invisible {
  visibility: hidden;
}
    