:root {
  --page-bg: #f5f6f7;
  --panel-bg: #ffffff;
  --text: #222226;
  --text-soft: #555666;
  --muted: #8a8f9d;
  --line: #eef0f4;
  --link: #0d6efd;
  --mark: #ff6a4d;
  --container: min(1320px, calc(100vw - 32px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", Arial, sans-serif;
  background: var(--page-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

code {
  padding: 0.12em 0.38em;
  border-radius: 4px;
  background: #f4f5f7;
  color: #c7254e;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

pre {
  margin: 0;
  overflow-x: auto;
}

pre code {
  display: block;
  padding: 16px 18px;
  border-radius: 4px;
  border: 1px solid #e8e8ed;
  background: #f7f8fa;
  color: #2b2f36;
  line-height: 1.72;
}

.page-shell {
  min-height: 100vh;
  padding: 14px 0 60px;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 14px;
  border-bottom: 1px solid #e8eaf0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1f2329;
  font-weight: 700;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e7e9ef;
  background: #ffffff;
}

.brand-mark img {
  width: 24px;
  height: 24px;
}

.brand-name {
  font-size: 1rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 0.94rem;
  font-weight: 600;
}

.nav-link:hover,
.nav-link.is-active {
  color: #1f2329;
  background: #f0f2f5;
}

/* 文章页按 CSDN 风格收敛到白底正文容器。 */
.article-page {
  max-width: 1320px;
}

.article-panel,
.list-panel {
  background: var(--panel-bg);
}

.article-panel {
  padding: 24px 32px 34px;
}

.article-title {
  margin: 0;
  color: #1f2329;
  font-size: clamp(2rem, 2.7vw, 2.55rem);
  line-height: 1.24;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.article-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 4px;
  background: #fff1ed;
  color: var(--mark);
  font-size: 0.88rem;
  font-weight: 600;
}

.meta-separator {
  color: #c3c7d0;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.article-tags a,
.post-content a,
.text-link {
  color: var(--link);
}

.post-content {
  margin-top: 28px;
  color: #2b2f36;
  font-size: 1.02rem;
  line-height: 1.9;
}

.post-content > * + * {
  margin-top: 18px;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  color: #1f2329;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.post-content h2 {
  margin: 34px 0 0;
  font-size: 1.72rem;
}

.post-content h3 {
  margin: 30px 0 0;
  font-size: 1.34rem;
}

.post-content h4 {
  margin: 26px 0 0;
  font-size: 1.14rem;
}

.post-content p {
  margin: 0;
}

.post-content strong {
  color: #1f2329;
}

.post-content ul,
.post-content ol {
  margin: 0;
  padding-left: 1.45rem;
}

.post-content li + li {
  margin-top: 8px;
}

.post-content blockquote {
  margin: 0;
  padding: 14px 18px;
  border-left: 4px solid #d9dce3;
  background: #f7f8fa;
  color: var(--text-soft);
}

.post-content hr {
  margin: 8px 0;
  border: 0;
  border-top: 1px solid #e7e9ef;
}

.post-image {
  margin: 0;
}

.post-image img {
  width: auto;
  max-width: 100%;
  border: 1px solid #edf0f4;
  background: #f7f8fa;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #e8e8ed;
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 15px;
  vertical-align: top;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
}

th {
  background: #f7f8fa;
  color: #1f2329;
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.footer {
  max-width: 1320px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.footer-links a {
  color: var(--text-soft);
}

.hero,
.sidebar,
.content-grid {
  display: contents;
}

.hero-panel,
.eyebrow-row,
.button-row,
.chip-row,
.side-card {
  display: none;
}

.list-panel {
  display: grid;
  gap: 16px;
  padding: 24px 32px;
}

.post-card {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.post-card:last-child {
  border-bottom: 0;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-card h2 {
  margin: 10px 0 0;
  color: #1f2329;
  font-size: 1.45rem;
  line-height: 1.35;
}

.post-card p {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.78;
}

.text-link {
  display: inline-flex;
  margin-top: 12px;
  font-weight: 600;
}

@media (max-width: 640px) {
  :root {
    --container: min(100vw, calc(100vw - 20px));
  }

  .page-shell {
    padding-top: 0;
  }

  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .article-panel,
  .list-panel {
    padding: 20px 18px 28px;
  }

  .article-title {
    font-size: 1.72rem;
  }

  .article-meta,
  .article-tags,
  .post-content {
    font-size: 0.96rem;
  }

  table {
    min-width: 560px;
  }
}
