﻿/* 闹市圈 NSQ - 极简博客风格,参照 Bear Blog / Pieter Levels 个人站 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #fafaf7;
  --text: #1a1a1a;
  --text-soft: #4a4a4a;
  --text-muted: #888;
  --border: #e8e8e3;
  --accent: #c83e2c;       /* 朱砂红，中式 */
  --accent-soft: #fef3f2;
  --code-bg: #f5f5f0;
  --link: #2563eb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --text: #ededed;
    --text-soft: #c0c0c0;
    --text-muted: #888;
    --border: #2a2a2a;
    --accent: #ff6b58;
    --accent-soft: #2a1816;
    --code-bg: #232323;
    --link: #60a5fa;
  }
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

code {
  font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border);
  line-height: 1.55;
}

pre code {
  background: transparent;
  padding: 0;
  font-size: 0.88em;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
  margin: 20px 0;
  color: var(--text-soft);
  font-style: italic;
}

/* ── Layout ── */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  position: sticky;
  top: 0;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(12px);
  z-index: 50;
}

@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(26, 26, 26, 0.85); }
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.site-title:hover { text-decoration: none; color: var(--accent); }

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 14.5px;
  align-items: center;
}

.site-nav a {
  color: var(--text-soft);
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav .lang-pill {
  font-size: 12.5px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
}

/* CTA: 跳转 magnetgoogo.com 的显眼按钮 */
.cta-magnetgoogo {
  background: var(--accent);
  color: #fff !important;
  padding: 7px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}

.cta-magnetgoogo:hover {
  background: #a82e1f;
  text-decoration: none !important;
  color: #fff !important;
}

main {
  min-height: 60vh;
  padding: 40px 0 80px;
}

/* ── Home ── */
.intro {
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--border);
}

.intro h1 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.intro p {
  color: var(--text-soft);
  font-size: 16.5px;
  max-width: 580px;
}

.section {
  padding: 36px 0 8px;
}

.section h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 18px;
  font-weight: 600;
}

/* ── Project showcase ── */
.project-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin: 12px 0;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg) 50%);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.project-card .icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  flex-shrink: 0;
}

.project-card .body {
  flex: 1;
  min-width: 240px;
}

.project-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.project-card p {
  color: var(--text-soft);
  font-size: 14.5px;
  margin-bottom: 12px;
}

.project-card .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13.5px;
}

.btn-primary {
  background: var(--accent);
  color: #fff !important;
}

.btn-primary:hover {
  background: #a82e1f;
  text-decoration: none !important;
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-soft) !important;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
  text-decoration: none !important;
}

/* ── Post list ── */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
}

.post-list li:last-child { border-bottom: none; }

.post-list time {
  color: var(--text-muted);
  font-size: 13.5px;
  min-width: 90px;
  font-variant-numeric: tabular-nums;
}

.post-list a {
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  flex: 1;
}

.post-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Article page ── */
article.post {
  padding: 8px 0 40px;
}

article.post header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

article.post h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.3;
}

article.post .meta {
  font-size: 13.5px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

article.post .meta .tag {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

article.post h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 36px 0 12px;
  letter-spacing: -0.01em;
}

article.post h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 10px;
}

article.post p,
article.post ul,
article.post ol {
  margin: 14px 0;
  color: var(--text);
  font-size: 16.5px;
}

article.post ul,
article.post ol {
  padding-left: 24px;
}

article.post li {
  margin: 6px 0;
}

article.post hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

article.post img {
  border-radius: 8px;
  margin: 20px auto;
  display: block;
}

article.post .callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  color: var(--text);
}

article.post .callout strong {
  color: var(--accent);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
}

table th, table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}

table th {
  background: var(--code-bg);
  font-weight: 600;
}

/* ── Author bio (article footer) ── */
.author-bio {
  margin: 40px 0 28px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--accent-soft);
}

.author-bio h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.author-bio p {
  color: var(--text);
  font-size: 15.5px;
  margin: 0 0 12px !important;
}

.author-bio strong {
  color: var(--accent);
}

/* ── Related posts ── */
.related {
  margin: 48px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.related h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-weight: 600;
}

.related ul {
  list-style: none;
  padding: 0;
}

.related li {
  padding: 8px 0;
}

.related a {
  color: var(--text);
  font-size: 15.5px;
}

.related a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 48px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer a {
  color: var(--text-muted);
  margin: 0 8px;
}

.site-footer .icp {
  font-size: 12.5px;
}

@media (max-width: 600px) {
  html { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .site-nav { gap: 14px; font-size: 14px; }
  .site-nav .hide-mobile { display: none; }
  article.post h1 { font-size: 26px; }
  .intro h1 { font-size: 26px; }
  .post-list li { flex-direction: column; gap: 4px; }
  .post-list time { min-width: auto; }
}
