/* 主题：echo —— 参考 cn.kexec.www/usr/themes/echo
 * 视觉：浅灰底(#f8f8f8) + 橙色强调(#ff6e00) + 紧凑极简 + 橙色滚动条
 */
:root {
  --bg: #f8f8f8;
  --fg: #444444;
  --muted: #999999;
  --accent: #ff6e00;
  --border: #e8e9e7;
  --code-bg: #f3f3f3;
  --code-fg: #b94a48;
  --max: 820px;
}
* { box-sizing: border-box; }
::-webkit-scrollbar { width: .5em; height: .5em; }
::-webkit-scrollbar-thumb { background: #999; border-radius: .25em; }
::-webkit-scrollbar-thumb:hover { background: #666; }
::-webkit-scrollbar-resizer { background: #ff6e00; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  display: flex; flex-direction: column; min-height: 100vh;
  font: 15px/1.7 "Microsoft YaHei", "微软雅黑", Consolas, Arial, sans-serif;
}
.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #ff8c33; }
del, s { text-decoration: line-through; opacity: .7; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; gap: 16px; padding: 14px 20px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 19px; color: var(--fg); display: flex; align-items: center; gap: 8px; }
.logo-icon { display: inline; vertical-align: middle; }
.nav { display: flex; gap: 16px; }
.nav a { color: var(--fg); }
.nav a:hover { color: var(--accent); }
.search input {
  background: #fff; color: var(--fg); border: 1px solid var(--border);
  border-radius: 3px; padding: 6px 10px; font-size: 14px;
}
.theme-switcher { margin-left: auto; }
.theme-switcher select {
  font-size: 13px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); background: transparent; cursor: pointer; outline: none; max-width: 130px;
}
.theme-switcher select:focus { border-color: var(--accent); color: var(--accent); }

main.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-top: 28px; padding-bottom: 48px; flex-grow: 1; }
.page-title { font-size: 24px; margin: 0 0 20px; }

.post-item {
  padding: 16px; margin-bottom: 14px; background: #fff; border: 1px solid var(--border);
  border-radius: 6px; transition: box-shadow .2s;
  display: flex; gap: 16px; align-items: flex-start;
}
.post-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.post-thumb { flex: 0 0 200px; width: 200px; height: 130px; border-radius: 6px; overflow: hidden; display: block; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-body { flex: 1; min-width: 0; }
.post-title { font-size: 19px; margin: 0 0 6px; }
.post-title a { color: var(--fg); }
.post-title a:hover { color: var(--accent); }
.post-meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.post-meta .dot { opacity: .5; }
.post-excerpt { color: #666; margin: 8px 0 0; }

.post-detail .post-title { font-size: 28px; margin: 0 0 8px; }
.post-cover {
  width: 100%; max-height: 360px; object-fit: cover; border-radius: 8px;
  margin-bottom: 20px; display: block;
}
.about-banner {
  width: 100%; max-height: 360px; object-fit: cover; border-radius: 8px;
  margin-bottom: 24px; display: block;
}
.draft-banner {
  background: #fff3e0; color: #b45309; padding: 8px 12px; border-radius: 4px; margin-bottom: 16px; font-size: 14px;
}
.toc {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 16px; margin: 18px 0; font-size: 14px;
}
.toc ul { margin: 6px 0 0; padding-left: 18px; }
.toc .lv-3 { padding-left: 14px; }

.post-content { margin-top: 18px; }
.post-content img { max-width: 100%; border-radius: 6px; }
.post-content pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 14px 16px; overflow: auto;
}
.post-content code { font-family: Menlo, Monaco, Consolas, monospace; font-size: 14px; }
.post-content :not(pre) > code { background: var(--code-bg); padding: 2px 6px; border-radius: 3px; color: var(--code-fg); }
.post-content blockquote {
  margin: 16px 0; padding: 8px 16px; border-left: 4px solid var(--accent);
  background: #fff; color: var(--muted);
}
.post-content blockquote > :last-child { margin-bottom: 0; }
.post-content blockquote > :first-child { margin-top: 0; }
.post-content table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 8px 12px; }
.post-content th { background: #f3f3f3; }
.post-content td { text-align: center; }
.post-content h2 { font-size: 21px; margin: 26px 0 12px -0.03em; font-weight: 600; }
.post-content h3 { font-size: 17px; margin: 20px 0 10px -0.02em; font-weight: 600; }
.post-content p { margin: 0 0 12px; }
.post-content ul, .post-content ol { margin: 0 0 12px; padding-left: 22px; }
.post-content li { margin: 4px 0; }
.heading-permalink { opacity: 0; margin-left: 6px; font-size: 14px; }
.post-content h2:hover .heading-permalink, .post-content h3:hover .heading-permalink { opacity: .6; }

.pager { display: flex; justify-content: space-between; margin-top: 32px; gap: 12px; }
.tag { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-size: 12px; color: var(--muted); }

.pagination { margin-top: 24px; display: flex; gap: 8px; list-style: none; padding: 0; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.pagination .active span { background: var(--accent); color: #fff; border-color: var(--accent); }

.site-footer { border-top: 1px solid var(--border); padding: 18px 0; color: var(--muted); font-size: 13px; background: #fff; }
.site-footer .container { display: flex; gap: 14px; align-items: center; }
.empty, .search-result { color: var(--muted); }

.back-to-top {
  position: fixed; bottom: 32px; right: 32px; z-index: 99;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s, visibility .25s, transform .25s, color .2s, border-color .2s;
  display: flex; align-items: center; justify-content: center;
}
.back-to-top.visible {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.back-to-top:hover {
  color: var(--accent); border-color: var(--accent);
}

@media (max-width: 600px) {
  .post-item { flex-direction: column; }
  .post-thumb { flex: none; width: 100%; height: 180px; }
}
