/* ============================================================
 * 出海笔记 · 极简博客样式(秦半两风格)
 * ============================================================ */

:root {
  --text: #1f2328;
  --text-light: #6b7280;
  --accent: #9a3412;          /* 赭红,古钱"半两"的调子 */
  --accent-soft: #c2410c;
  --bg: #ffffff;
  --bg-soft: #f7f6f3;
  --border: #e5e2dc;
  --code-bg: #f3f1ec;
  --max-width: 680px;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  padding: 0 20px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Microsoft YaHei", sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-soft); text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 0 64px;
}

/* ---------- 头部 ---------- */
.site-header { margin-bottom: 36px; }

.site-title {
  margin: 0 0 4px;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.site-title a { color: var(--text); }
.site-title a:hover { text-decoration: none; color: var(--accent); }

.site-subtitle {
  margin: 0 0 20px;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ---------- 分类导航 ---------- */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.categories a {
  padding: 3px 12px;
  font-size: 0.88rem;
  color: var(--text-light);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.15s ease;
}
.categories a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
.categories a.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- 文章列表 ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }

.post-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.post-item:last-child { border-bottom: none; }

.post-date {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
  width: 5.6em;
}

.post-title {
  flex: 1;
  font-size: 1.02rem;
}
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); }

.post-cat {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 6px;
  white-space: nowrap;
}

.empty-tip {
  padding: 48px 0;
  text-align: center;
  color: var(--text-light);
}

/* ---------- 关于区块 ---------- */
.about-block {
  margin-top: 48px;
  padding: 20px 24px;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--text-light);
  white-space: pre-line;
}
.about-block strong { color: var(--text); }

/* ---------- 文章页 ---------- */
.post-header { margin-bottom: 32px; }

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--text-light);
}

.post-title-page {
  margin: 0 0 10px;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.4;
}

.post-meta {
  font-size: 0.88rem;
  color: var(--text-light);
}
.post-meta .post-cat,
.post-meta a.post-cat { margin-left: 8px; }
.post-meta a.post-cat {
  color: var(--text-light);
  text-decoration: none;
}
.post-meta a.post-cat:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.post-body { font-size: 1rem; }

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
  margin: 1.8em 0 0.7em;
  line-height: 1.5;
}
.post-body h1 { font-size: 1.45rem; }
.post-body h2 {
  font-size: 1.28rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.post-body h3 { font-size: 1.12rem; }
.post-body h4 { font-size: 1rem; }

.post-body p { margin: 1em 0; }

.post-body ul,
.post-body ol { padding-left: 1.6em; margin: 1em 0; }
.post-body li { margin: 0.3em 0; }

.post-body blockquote {
  margin: 1.2em 0;
  padding: 4px 18px;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  color: var(--text-light);
  border-radius: 0 6px 6px 0;
}

.post-body code {
  font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.post-body pre {
  background: #26231f;
  color: #e8e4de;
  padding: 16px 18px;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.6;
}
.post-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.post-body img {
  max-width: 100%;
  border-radius: 6px;
  display: block;
  margin: 1.2em auto;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.2em 0;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.92rem;
}
.post-body th,
.post-body td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.post-body th { background: var(--bg-soft); }

/* 上一篇 / 下一篇 */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}
.post-nav a {
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-nav .nav-next { margin-left: auto; text-align: right; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-light);
  text-align: center;
}
.site-footer a { color: var(--text-light); text-decoration: underline; }

/* ---------- 移动端 ---------- */
@media (max-width: 560px) {
  html { font-size: 16px; }
  body { padding: 0 16px; }
  .container { padding: 32px 0 48px; }
  .post-item { flex-wrap: wrap; gap: 4px 10px; }
  .post-title { flex-basis: 100%; order: -1; }
}
