:root {
  --ink: #14171a;
  --ink-2: #333a41;
  --muted: #6f767e;
  --line: rgba(20, 23, 26, .12);
  --line-soft: rgba(20, 23, 26, .07);
  --paper: #ffffff;
  --canvas: #f8f7f4;
  --accent: #2271b1;
  --accent-dark: #185887;
  --serif: "Noto Serif SC", "Songti SC", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 26px; }

/* ---------- top bar ---------- */
.topbar {
  background: #12161a;
  color: rgba(255, 255, 255, .62);
  font-size: 12.5px;
  letter-spacing: .01em;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 36px; }
.topbar a { color: rgba(255, 255, 255, .78); transition: color .16s; }
.topbar a:hover { color: #fff; }
.topbar .dot-sep { opacity: .35; margin: 0 10px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { display: flex; align-items: center; gap: 34px; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 42px; height: 42px; flex: none;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  letter-spacing: -.02em;
}
.brand-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.brand-title {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-tagline { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.site-nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.site-nav a { position: relative; color: var(--ink-2); padding: 4px 0; white-space: nowrap; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: var(--accent); transition: right .2s ease;
}
.site-nav a:hover::after, .site-nav a.active::after { right: 0; }
.site-nav a.active { color: var(--accent); }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search input {
  width: 210px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 14px 9px 34px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .16s, box-shadow .16s, width .2s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 113, 177, .12); width: 250px; }
.btn-ghost {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13px;
  color: var(--ink-2);
  transition: border-color .16s, color .16s;
  white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 302px; gap: 52px; padding: 36px 0 72px; }
main { min-width: 0; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 20px; }
.section-head h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -.01em;
}
.section-head h2::before {
  content: ""; display: inline-block; width: 4px; height: 16px;
  background: var(--accent); border-radius: 2px; margin-right: 10px;
  vertical-align: -1px;
}
.section-head .sub { font-size: 12.5px; color: var(--muted); }

/* ---------- feature ---------- */
.feature {
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 46px;
}
.feature-media {
  position: relative;
  min-height: 350px;
  background: linear-gradient(150deg, #dfe6ec, #c8d3dc);
  background-size: cover;
  background-position: center;
}
.feature-media .tag-flag {
  position: absolute; left: 18px; top: 18px;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  font-size: 11.5px;
  letter-spacing: .05em;
  padding: 5px 11px;
  border-radius: 999px;
}
.feature-body { padding: 40px 38px; display: flex; flex-direction: column; justify-content: center; }
.feature-body h1 {
  font-family: var(--serif);
  font-size: 29px;
  line-height: 1.42;
  letter-spacing: -.015em;
  margin: 14px 0 12px;
  font-weight: 600;
}
.feature-body h1 a:hover { color: var(--accent); }
.feature-body p { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

.badge {
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--accent);
  background: rgba(34, 113, 177, .09);
  padding: 4px 10px;
  border-radius: 999px;
}
.badge.plain { background: #f0eeea; color: #6b6257; }

.meta { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .45; }
.meta .author { color: var(--ink-2); font-weight: 500; }

/* ---------- cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: rgba(20, 23, 26, .18); }
.card-media {
  aspect-ratio: 16 / 9;
  background: linear-gradient(150deg, #e4e9ee, #cdd7e0);
  background-size: cover; background-position: center;
  position: relative;
}
.card-media .cat {
  position: absolute; left: 14px; top: 14px;
  background: rgba(18, 22, 26, .72);
  color: #fff;
  font-size: 11px; letter-spacing: .04em;
  padding: 4px 9px; border-radius: 6px;
  backdrop-filter: blur(4px);
}
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  margin: 10px 0 8px;
  font-weight: 600;
}
.card-body h3 a:hover { color: var(--accent); }
.card-body p { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.72; }
.card-body .meta { margin-top: auto; }

/* ---------- list item (compact) ---------- */
.list-item { display: flex; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.list-item:first-child { padding-top: 0; }
.list-item .thumb {
  width: 132px; height: 92px; flex: none; border-radius: 9px;
  background: #e4e9ee; background-size: cover; background-position: center;
}
.list-item h3 { font-family: var(--serif); font-size: 16.5px; margin: 0 0 6px; font-weight: 600; line-height: 1.5; }
.list-item p { margin: 0 0 8px; font-size: 12.8px; color: var(--muted); }

/* ---------- sidebar ---------- */
.sidebar { min-width: 0; }
.widget {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.widget h4 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8b9098;
}
.widget p { font-size: 13px; color: var(--muted); margin: 0; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li { border-bottom: 1px dashed var(--line-soft); }
.cat-list li:last-child { border-bottom: none; }
.cat-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; font-size: 13.5px; color: var(--ink-2);
  transition: color .16s;
}
.cat-list a:hover { color: var(--accent); }
.cat-list .count { font-size: 11.5px; color: var(--muted); background: #f3f1ed; border-radius: 999px; padding: 1px 8px; }

.mini-post { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.mini-post:last-child { border-bottom: none; padding-bottom: 0; }
.mini-post .num {
  font-family: var(--serif); font-size: 15px; color: #c2bdb4; width: 16px; flex: none; line-height: 1.6;
}
.mini-post a { font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.mini-post a:hover { color: var(--accent); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f1ed;
  color: #5b6169;
  transition: background .16s, color .16s;
}
.tag-cloud a:hover { background: var(--accent); color: #fff; }

.about-box { display: flex; gap: 13px; align-items: center; margin-bottom: 12px; }
.about-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: #e8e2d8; color: #7a6a53;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 18px;
}
.newsletter input {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 12px; font-size: 13px; outline: none; background: #fff;
}
.newsletter input:focus { border-color: var(--accent); }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 9px; padding: 9px 16px; font-size: 13px; font-weight: 500;
  transition: background .16s;
}
.btn-primary:hover { background: var(--accent-dark); }
.w-full { width: 100%; }

/* ---------- pager ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 44px; }
.pager button {
  min-width: 38px; height: 38px; padding: 0 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13px; color: var(--ink-2);
  transition: border-color .16s, color .16s, background .16s;
}
.pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pager button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager .ellipsis { color: var(--muted); font-size: 13px; }

/* ---------- article ---------- */
.article { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 18px; padding: 40px 48px 48px; }
.crumbs { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: .5; }
.article h1 {
  font-family: var(--serif);
  font-size: 37px;
  line-height: 1.35;
  letter-spacing: -.02em;
  margin: 18px 0 14px;
  font-weight: 600;
}
.article-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 26px; border-bottom: 1px solid var(--line-soft); }
.article-meta .avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #e8e2d8; color: #7a6a53;
  display: grid; place-items: center; font-family: var(--serif); font-size: 14px;
}
.article-hero {
  margin: 26px 0 34px;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 8;
  background: linear-gradient(150deg, #e4e9ee, #cdd7e0);
  background-size: cover; background-position: center;
}

.prose { font-size: 16.5px; line-height: 1.9; color: #23282e; }
.prose > p:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.35em; }
.prose h2 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 2.1em 0 .75em;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  line-height: 1.5;
}
.prose h3 { font-size: 18px; margin: 1.7em 0 .6em; }
.prose a { color: var(--accent); border-bottom: 1px solid rgba(34, 113, 177, .35); }
.prose strong { color: #101418; }
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.35em; }
.prose li { margin: .45em 0; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin: 1.8em 0;
  padding: 16px 22px;
  background: #faf8f4;
  border-left: 3px solid #d9d3c7;
  border-radius: 0 10px 10px 0;
  color: #4d545c;
  font-size: 15.5px;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  font-family: var(--mono);
  font-size: .875em;
  background: #f1efe9;
  padding: 2px 6px;
  border-radius: 5px;
  color: #9a4b2f;
}
.prose pre {
  background: #1b1f24;
  color: #e7edf3;
  padding: 20px 22px;
  border-radius: 11px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
  margin: 0 0 1.5em;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

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

.author-box {
  display: flex; gap: 16px; align-items: flex-start;
  background: #faf8f4; border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 20px 22px; margin: 30px 0 0;
}
.author-box .about-avatar { width: 50px; height: 50px; }
.author-box h5 { margin: 2px 0 5px; font-size: 14px; }
.author-box p { margin: 0; font-size: 12.8px; color: var(--muted); }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 34px 0 0; }
.prevnext a {
  border: 1px solid var(--line-soft); border-radius: 11px; padding: 14px 18px;
  background: #fff; transition: border-color .16s;
  min-width: 0;
}
.prevnext a:hover { border-color: var(--accent); }
.prevnext span { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: .05em; margin-bottom: 4px; }
.prevnext strong { font-size: 13.5px; font-weight: 500; display: block; line-height: 1.5; }

/* ---------- comments ---------- */
.comments { margin-top: 34px; padding: 30px 34px 34px; }
.comment-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.comment-head h3 { font-family: var(--serif); font-size: 18px; margin: 0; font-weight: 600; }
.comment-head .count { font-size: 12.5px; color: var(--muted); }
.comment { display: flex; gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.comment:last-of-type { border-bottom: none; }
.comment .avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 14px; font-family: var(--serif);
  background: #eef0f3; color: #5c6570;
}
.comment .who { font-size: 13.5px; font-weight: 500; }
.comment .when { font-size: 12px; color: var(--muted); }
.comment p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.comment-form { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.comment-form h4 { font-size: 15px; margin: 0 0 4px; }
.comment-form .hint { font-size: 12.5px; color: var(--muted); margin: 0 0 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; font-size: 13.5px; background: #fff; outline: none;
  transition: border-color .16s, box-shadow .16s;
  resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 113, 177, .1); }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; }
.form-msg { font-size: 12.5px; color: var(--muted); }
.form-msg.ok { color: #1a7f4b; }
.form-msg.bad { color: #b3261e; }

/* ---------- footer ---------- */
.site-footer { background: #12161a; color: rgba(255, 255, 255, .66); padding: 52px 0 26px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 34px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.site-footer h5 { color: #fff; font-size: 13px; font-weight: 500; margin: 0 0 14px; letter-spacing: .04em; }
.site-footer p { font-size: 13px; line-height: 1.8; color: rgba(255, 255, 255, .55); margin: 0; }
.site-footer .fbrand { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; color: #fff; font-family: var(--serif); font-size: 17px; }
.site-footer .brand-mark { width: 34px; height: 34px; font-size: 17px; border-radius: 9px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer li a { font-size: 13px; color: rgba(255, 255, 255, .58); transition: color .16s; }
.site-footer li a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; font-size: 12px; color: rgba(255, 255, 255, .4); flex-wrap: wrap; gap: 10px; }

/* ---------- misc ---------- */
.empty { padding: 60px 0; text-align: center; color: var(--muted); font-size: 14px; }
.skeleton { background: linear-gradient(90deg, #f1efea 25%, #e8e5df 37%, #f1efea 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
  background: #12161a; color: #fff; font-size: 13px;
  padding: 11px 20px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 99;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .widget { margin-bottom: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}
@media (max-width: 860px) {
  .site-nav { display: none; }
  .feature { grid-template-columns: 1fr; }
  .feature-media { min-height: 220px; }
  .feature-body { padding: 26px 24px; }
  .feature-body h1 { font-size: 24px; }
  .post-grid { grid-template-columns: 1fr; }
  .article { padding: 26px 22px 30px; }
  .article h1 { font-size: 27px; }
  .prose { font-size: 15.5px; }
  .prevnext { grid-template-columns: 1fr; }
  .search input { width: 150px; }
  .search input:focus { width: 170px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .list-item .thumb { width: 96px; height: 76px; }
}

/* ---------- media anchors ---------- */
a.card-media, a.feature-media, a.thumb { display: block; position: relative; overflow: hidden; }
.card-media img, .feature-media img, .article-hero img, .thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
a.card-media:hover img, a.feature-media:hover img { transform: scale(1.03); }
.article-hero { overflow: hidden; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
