/* 奈斯的技术日志 — 站点公共样式
   与 privacy.html / terms.html 的配色保持一致（--brand: #208AEF） */

:root {
  --brand: #208AEF;
  --brand-dark: #1A6FBF;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --text: #1C1C1E;
  --text-secondary: #6E6E73;
  --border: #E5E5EA;
  --radius: 14px;
  --max-width: 760px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  flex: 1 0 auto;
}

/* ── 顶部 ── */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
  padding-bottom: 18px;
  flex: 0 0 auto;
}

.site-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.3px;
}

.site-title span { color: var(--brand); }

.site-nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a.active { color: var(--brand); }

/* ── 正文 ── */
main { padding: 36px 0 20px; }

.intro { margin-bottom: 36px; }

.intro h1 {
  font-size: 27px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}

.intro p {
  color: var(--text-secondary);
  font-size: 15px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
  padding-left: 10px;
  border-left: 3px solid var(--brand);
  line-height: 1.2;
}

/* ── 文章列表 ── */
.post-list {
  list-style: none;
  margin-bottom: 44px;
}

.post-list li { margin-bottom: 14px; }

.post-item {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.post-item:hover {
  border-color: rgba(32, 138, 239, 0.45);
  box-shadow: 0 6px 20px rgba(32, 138, 239, 0.09);
  transform: translateY(-1px);
}

.post-item h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 7px;
  line-height: 1.5;
}

.post-item .excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.post-item .date {
  display: inline-block;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ── 项目卡 ── */
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 44px;
}

.project-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-card p {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  font-size: 12.5px;
  color: var(--brand);
  background: rgba(32, 138, 239, 0.09);
  border-radius: 999px;
  padding: 3px 11px;
}

/* ── 文章页 ── */
.article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 30px 30px;
}

.article h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 10px;
}

.article .article-meta {
  font-size: 13px;
  color: var(--text-secondary);
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.article h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 32px 0 12px;
  line-height: 1.5;
}

.article h2:first-of-type { margin-top: 4px; }

.article h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 22px 0 8px;
}

.article p { margin-bottom: 14px; }

.article ul,
.article ol {
  margin: 0 0 16px 22px;
}

.article li { margin-bottom: 7px; }

.article a { color: var(--brand); }

.article strong { font-weight: 600; }

.article code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  background: #F1F3F6;
  border-radius: 5px;
  padding: 2px 6px;
}

.article pre {
  background: #1F2430;
  color: #E6E9EF;
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 18px;
  line-height: 1.6;
}

.article pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 13px;
}

.article blockquote {
  border-left: 3px solid var(--brand);
  background: rgba(32, 138, 239, 0.05);
  padding: 12px 16px;
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 14.5px;
  border-radius: 0 8px 8px 0;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 14px;
}

.article th,
.article td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}

.article th {
  background: #F7F9FC;
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}

.back-link:hover { color: var(--brand); }

/* ── 页脚 ── */
.site-footer {
  flex-shrink: 0;
  margin-top: 40px;
  padding: 26px 20px 34px;
  border-top: 1px solid var(--border);
  background: var(--card);
  text-align: center;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.9;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-footer a:hover { color: var(--brand); }

.site-footer .beian img {
  height: 13px;
  vertical-align: -1px;
  margin-right: 3px;
}

@media (max-width: 520px) {
  body { font-size: 15.5px; }
  .intro h1 { font-size: 23px; }
  .article { padding: 26px 20px 22px; }
  .article h1 { font-size: 21px; }
  .site-header .wrap { padding-top: 14px; padding-bottom: 14px; }
  .site-nav { gap: 16px; }
}
