:root {
  --paper: #f4f0e7;
  --ink: #24231f;
  --muted: #777267;
  --moss: #65705c;
  --clay: #a3664d;
  --line: rgba(36, 35, 31, .14);
}

* { box-sizing: border-box; }
html { font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 15px; color: var(--ink); background: var(--paper); text-rendering: optimizeLegibility; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }

.article-header, .site-footer, main { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.article-header { height: 74px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.brand { font: 20px "Songti SC", "STSong", serif; letter-spacing: .12em; display: flex; gap: 10px; align-items: center; }
.brand span { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid; border-radius: 50%; font-size: 13px; }
.article-header nav { display: flex; gap: 24px; font-size: 13px; }
.article-header nav a { padding-block: 8px; }

.post-head { max-width: 720px; margin: 52px auto 38px; text-align: center; }
.eyebrow { margin: 0; color: var(--clay); font-size: 10px; font-weight: 700; letter-spacing: .2em; }
.post-head h1 { font: 400 clamp(34px, 4.8vw, 50px)/1.32 "Songti SC", "STSong", serif; letter-spacing: -.03em; text-wrap: balance; margin: 16px 0 14px; }
.excerpt { max-width: 580px; margin: 0 auto; color: var(--muted); font-size: 14px; line-height: 1.68; text-wrap: balance; }

.cover { width: min(860px, 100%); margin: 0 auto 46px; }
.cover img { display: block; width: 100%; max-height: 580px; object-fit: contain; border-radius: 12px; }
.article-body { max-width: 660px; margin-inline: auto; font: 17px/1.74 "Songti SC", "STSong", serif; letter-spacing: .016em; overflow-wrap: anywhere; }
.article-body > :first-child { margin-top: 0; }
.article-body > :last-child { margin-bottom: 0; }
.article-body h2, .article-body h3 { font-weight: 400; line-height: 1.45; text-wrap: balance; margin: 1.45em 0 .5em; }
.article-body h2 { font-size: 25px; }
.article-body h3 { font-size: 20px; }
.article-body p { margin: .72em 0; }
.article-body ul, .article-body ol { padding-left: 1.5em; }
.article-body li { margin: .35em 0; }
.article-body blockquote { margin: 1.35em 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--clay); color: var(--muted); }
.article-body blockquote p { margin-block: .5em; }
.article-body img { display: block; max-width: min(760px, calc(100vw - 32px)); height: auto; margin: 1.65em 50%; object-fit: contain; border-radius: 12px; transform: translateX(-50%); }
.article-body a { color: var(--clay); border-bottom: 1px solid currentColor; }
.article-body pre { overflow: auto; padding: 16px; background: #2e302c; color: var(--paper); border-radius: 3px; font: 13px/1.6 ui-monospace, monospace; }
.article-body :not(pre) > code { padding: 2px 5px; background: rgba(36, 35, 31, .08); font: .86em ui-monospace, monospace; }

.post-tags { max-width: 660px; margin: 40px auto 62px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 7px; }
.post-tags span { padding: 5px 11px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 12px; }
.comments-shell { max-width: 660px; margin: 0 auto 66px; padding-top: 40px; border-top: 1px solid var(--ink); }
.comments-shell h2 { font: 400 28px "Songti SC", "STSong", serif; margin: 12px 0 22px; }
.comments-loading { color: var(--muted); }
.comment-form { display: grid; gap: 10px; margin: 18px 0 28px; }
.comment-form input, .comment-form textarea { width: 100%; border: 1px solid var(--line); background: rgba(255, 255, 255, .28); padding: 10px 12px; color: var(--ink); font: inherit; }
.comment-form textarea { min-height: 96px; resize: vertical; }
.comment-form button { justify-self: start; border: 0; background: var(--ink); color: var(--paper); padding: 9px 17px; cursor: pointer; }
.comment-item { padding: 16px 0; border-top: 1px solid var(--line); }
.comment-meta { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
.comment-item p { line-height: 1.75; white-space: pre-wrap; }
.comment-reply { margin-left: 30px; }
.comment-status { color: var(--moss); }

.site-footer { min-height: 108px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.site-footer p { font: 15px "Songti SC", "STSong", serif; }

@media (min-width: 1180px) {
  main { width: min(1280px, calc(100% - 64px)); }
  article.has-cover { display: grid; grid-template-columns: minmax(380px, 1.05fr) minmax(420px, .95fr); grid-template-rows: auto auto auto; column-gap: clamp(48px, 5vw, 76px); align-items: start; margin-top: 52px; }
  .has-cover .post-head { grid-column: 2; grid-row: 1; width: 100%; margin: 0 0 38px; text-align: left; }
  .has-cover .excerpt { margin-left: 0; }
  .has-cover .cover { grid-column: 1; grid-row: 1 / span 3; width: 100%; margin: 0; }
  .has-cover .cover img { max-height: 720px; }
  .has-cover .article-body { grid-column: 2; grid-row: 2; width: 100%; }
  .has-cover .article-body img { max-width: 100%; margin-inline: auto; transform: none; }
  .has-cover .post-tags { grid-column: 2; grid-row: 3; width: 100%; }
}

@media (max-width: 720px) {
  .article-header, .site-footer, main { width: calc(100% - 28px); }
  .article-header { height: 66px; }
  .article-header nav { gap: 14px; }
  .article-header nav a:nth-child(2) { display: none; }
  .post-head { margin: 38px auto 28px; text-align: left; }
  .post-head h1 { font-size: clamp(32px, 10vw, 42px); margin-block: 14px 11px; }
  .excerpt { font-size: 13px; }
  .cover { margin-bottom: 34px; }
  .article-body { font-size: 16px; line-height: 1.7; }
  .article-body h2 { font-size: 23px; }
  .article-body h3 { font-size: 19px; }
  .article-body p { margin-block: .65em; }
  .article-body img { margin-block: 1.35em; }
  .post-tags { margin-block: 34px 50px; }
  .comments-shell { margin-bottom: 50px; padding-top: 34px; }
  .comment-reply { margin-left: 14px; }
  .site-footer { min-height: 104px; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; }
}
