/* ------------------------------------
 * Typecho Modern Minimalist Theme (Fixed)
 * @update  2024
 * --------------------------------- */

/* ------------------
 * 1. Global & Reset
 * --------------- */
body {
  background-color: #f8fafc; /* 极浅的冷灰底，衬托白卡片 */
  color: #334155;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
  font-size: 87.5%;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #3b82f6; /* 柔和的现代蓝 */
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover, a:active { color: #1d4ed8; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.02em;
}

pre, code {
  background: #f1f5f9;
  font-family: Menlo, Monaco, Consolas, monospace;
  font-size: .9em;
  border-radius: 6px;
}
code { padding: 2px 6px; color: #ef4444; }
pre { padding: 16px; overflow: auto; border: 1px solid #e2e8f0; }
pre code { padding: 0; color: #334155; background: transparent; }

blockquote {
  margin: 1.5em 0;
  padding: 12px 20px;
  border-left: 4px solid #3b82f6;
  background: #eff6ff;
  color: #475569;
  border-radius: 0 6px 6px 0;
}

table { border: 1px solid #e2e8f0; width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px 16px; border: 1px solid #e2e8f0; }
table th { background: #f8fafc; font-weight: 600; }

/* 表单控件 */
input[type="text"], input[type="email"], input[type="url"], input[type="password"], textarea {
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  width: 100%;
  border-radius: 8px;
  box-sizing: border-box;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="password"]:focus, textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ------------------
 * 2. Header & Nav (修复错位)
 * --------------- */
#header {
  padding: 40px 0 20px;
  background: #ffffff;
  margin-bottom: 30px;
  border-bottom: 1px solid #e2e8f0;
}

#logo { font-size: 2.2em; font-weight: 800; color: #0f172a; }
.description { margin: .5em 0 0; color: #64748b; font-size: 0.95em; }

/* 导航菜单 - 使用 flex 规整排列 */
#nav-menu {
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#nav-menu a {
  display: inline-block;
  padding: 0 20px;
  height: 36px;
  line-height: 36px;
  color: #475569;
  border-radius: 18px; /* 胶囊形 */
  transition: all 0.3s ease;
  background: #f1f5f9;
  border: none;
}
#nav-menu a:hover, #nav-menu .current {
  background: #3b82f6;
  color: #ffffff;
  transform: translateY(-1px);
}

/* 修复搜索框错位 - 隐藏多余的 label 并完美对齐 */
#search {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 30px;
  overflow: hidden;
  height: 40px; /* 固定高度避免变形 */
  transition: border-color 0.3s, box-shadow 0.3s;
  margin-top: 15px;
}
#search label { display: none !important; } /* 隐藏“搜索关键字”字眼，彻底解决重叠 */
#search input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 0 16px;
  height: 100%;
  border-radius: 0;
  font-size: 14px;
}
#search input:focus { box-shadow: none !important; }
#search button {
  position: static !important;
  height: 100% !important;
  padding: 0 24px;
  border: none;
  background: #3b82f6;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s;
  white-space: nowrap;
}
#search button:hover { background: #2563eb; }

/* ------------------
 * 3. Main & Cards (高级微阴影)
 * --------------- */
.post {
  padding: 30px;
  background: #ffffff;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid #e2e8f0; /* 细边框代替阴影，更干净 */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02); /* 极轻的微阴影 */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
}
.post:hover {
  transform: translateY(-4px); /* 悬停轻微上浮 */
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  border-color: #cbd5e1;
}

.post-title { margin: 0 0 12px 0; font-size: 1.5em; line-height: 1.4; }
.post-title a { color: #0f172a; }
.post-title a:hover { color: #3b82f6; }

.post-meta { margin: 0 0 16px 0; padding: 0; color: #64748b; font-size: .9em; display: flex; flex-wrap: wrap; gap: 16px; }
.post-meta li { display: inline-block; margin: 0; padding: 0; border-left: none; }
.post-meta li a { color: #64748b; }
.post-meta li a:hover { color: #3b82f6; }

.post-content { line-height: 1.8; color: #334155; }
.post .tags { clear: both; }

.more { text-align: center; margin-top: 20px; }
.more a {
  display: inline-block; padding: 8px 24px; background: #eff6ff; color: #3b82f6;
  border-radius: 20px; transition: all 0.3s;
}
.more a:hover { background: #3b82f6; color: #fff; transform: scale(1.02); }

/* 分页器 */
.page-navigator { list-style: none; margin: 30px 0; padding: 0; text-align: center; }
.page-navigator li { display: inline-block; margin: 0 4px; }
.page-navigator a {
  display: inline-block; padding: 0 16px; height: 36px; line-height: 36px;
  border-radius: 8px; background: #fff; color: #475569;
  border: 1px solid #e2e8f0; transition: all 0.2s;
}
.page-navigator a:hover, .page-navigator .current a {
  background: #3b82f6; color: #fff; border-color: #3b82f6;
}

/* ------------------
 * 4. Sidebar Widgets (侧边栏微阴影)
 * --------------- */
#secondary { padding-top: 0; }
.widget {
  margin-bottom: 24px;
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.3s, box-shadow 0.3s;
}
.widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.05);
}
.widget-list { list-style: none; padding: 0; }
.widget-list li { margin: 10px 0; line-height: 1.6; }
.widget-list li ul { margin-left: 15px; }

/* ------------------
 * 5. Comments
 * --------------- */
.comment-list li {
  padding: 20px; margin-top: 16px; border: 1px solid #e2e8f0;
  border-radius: 12px; background: #fff; transition: border-color 0.3s;
}
.comment-list li:hover { border-color: #cbd5e1; }
.comment-list li.comment-by-author { background: #fffbeb; border-color: #fde68a; }
.comment-author .avatar { float: left; margin-right: 12px; border-radius: 50%; transition: transform 0.3s; }
.comment-author .avatar:hover { transform: scale(1.05); }
#comment-form label { display: block; margin-bottom: 8px; font-weight: 500; color: #1e293b; }
#comment-form .required:after { content: " *"; color: #ef4444; }

/* ------------------
 * 6. Footer & Misc
 * --------------- */
#footer { padding: 3em 0; text-align: center; color: #94a3b8; font-size: 0.9em; border-top: 1px solid #e2e8f0; margin-top: 40px; }

.post-content img { max-width: 100%; border-radius: 8px; transition: transform 0.3s; }
.post-content img:hover { transform: scale(1.01); }
.post-content hr { margin: 2em auto; width: 80px; border: 2px solid #e2e8f0; border-width: 2px 0 0 0; }

.aligncenter { display: block; margin: 0 auto; }
.alignleft { float: left; margin-right: 15px; }
.alignright { float: right; margin-left: 15px; }

/* 响应式 */
@media (max-width: 768px) {
  #header, .post-title, .post-meta { text-align: center; }
  #nav-menu { justify-content: center; }
  .post-meta { justify-content: center; }
  .comment-author .avatar { float: none; display: block; margin: 0 auto 10px; }
}