/* 八千里路云和月 — 极简中国风
   宣纸底 / 墨色字 / 朱砂点睛。所有颜色走 CSS 变量，暗色模式自动反相。 */

:root {
  --paper: #f7f3e9;
  --paper-2: #efe9db;
  --ink: #2a2724;
  --ink-soft: #4b453c;
  --muted: #8b8274;
  --rule: rgba(42, 39, 36, 0.14);
  --rule-soft: rgba(42, 39, 36, 0.08);
  --cinnabar: #9c3b31;
  --cinnabar-soft: rgba(156, 59, 49, 0.45);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC",
           "Noto Serif SC", Georgia, "Times New Roman", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171614;
    --paper-2: #201e1a;
    --ink: #ddd6c5;
    --ink-soft: #c2baa9;
    --muted: #8d8577;
    --rule: rgba(221, 214, 197, 0.17);
    --rule-soft: rgba(221, 214, 197, 0.09);
    --cinnabar: #c76a5c;
    --cinnabar-soft: rgba(199, 106, 92, 0.5);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 560px at 100% -8%, rgba(156, 59, 49, 0.055), transparent 62%),
    radial-gradient(820px 460px at -12% 8%, rgba(42, 39, 36, 0.045), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

::selection { background: var(--cinnabar-soft); color: var(--ink); }

a { color: inherit; }

.wrap {
  max-width: 43rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 4rem;
}

/* ------------------------------------------------------------ 页头 */

.site-head { margin-bottom: 3.2rem; }

.head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-title {
  margin: 0;
  font-size: clamp(1.65rem, 5.2vw, 2.25rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.35;
}

.site-title a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.12em;
  transition: border-color 0.25s ease;
}

.site-title a:hover { border-bottom-color: var(--cinnabar-soft); }

.seal {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
  user-select: none;
}

.seal img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-sub {
  margin: 1.05rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------ 目录 */

.sec-title {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.42em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.sec-title::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  background: var(--cinnabar);
  border-radius: 1px;
  opacity: 0.85;
  flex: none;
}

.list { border-top: 1px solid var(--rule); padding-top: 0.3rem; }

.entry {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.82rem 0;
  border-bottom: 1px solid var(--rule-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.entry:hover .title { color: var(--cinnabar); }

.date {
  flex: none;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.title {
  font-size: 1.06rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.lead {
  flex: 1 1 auto;
  min-width: 1.5rem;
  border-bottom: 1px dotted var(--rule);
  transform: translateY(-0.3em);
}

.tag-wrap { flex: none; display: flex; gap: 0.45rem; }

.tag {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.1rem 0.42rem;
  letter-spacing: 0.04em;
}

.empty { color: var(--muted); padding: 1.4rem 0; }

/* ------------------------------------------------------------ 文章 */

.post { animation: rise 0.5s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.crumb {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.crumb a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

.crumb a:hover { color: var(--cinnabar); }

.post-title {
  margin: 1.1rem 0 0;
  font-size: clamp(1.5rem, 4.6vw, 2rem);
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.4;
}

.post-meta {
  margin: 0.85rem 0 0;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.meta {
  font-family: var(--sans);
}

.meta-date {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.post-quote {
  margin: 1.3rem 0 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
  letter-spacing: 0.05em;
  padding-left: 0.95rem;
  border-left: 2px solid var(--cinnabar-soft);
}

.post-body { padding-top: 0.6rem; }

.post-body p {
  margin: 0 0 1.3em;
  text-indent: 2em;
  line-height: 2.05;
  text-align: justify;
}

.post-body h2 {
  margin: 2.5em 0 1.1em;
  font-size: 1.18rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  position: relative;
  padding-left: 0.72rem;
}

.post-body h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.26em;
  bottom: 0.26em;
  width: 2px;
  background: var(--cinnabar);
  opacity: 0.7;
}

.post-body h3 {
  margin: 2em 0 0.8em;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
}

.post-body ul,
.post-body ol {
  margin: 1.2em 0 1.5em;
  padding-left: 1.5em;
}

.post-body li { margin: 0.35em 0; line-height: 2; }

.post-body blockquote {
  margin: 1.7em 0;
  padding: 0.1em 0 0.1em 1.15em;
  border-left: 2px solid var(--cinnabar-soft);
  color: var(--ink-soft);
}

.post-body blockquote p {
  text-indent: 0;
  margin: 0.45em 0;
  line-height: 1.95;
}

.post-body a {
  color: var(--cinnabar);
  text-decoration: none;
  border-bottom: 1px solid var(--cinnabar-soft);
}

.post-body code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.87em;
  background: rgba(42, 39, 36, 0.06);
  padding: 0.12em 0.38em;
  border-radius: 3px;
}

.post-body pre {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 1.5em 0;
  line-height: 1.6;
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.post-body img {
  max-width: 100%;
  border-radius: 3px;
  display: block;
  margin: 1.6em auto;
}

.post-body hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 2.6em auto;
  width: 38%;
}

.foot-crumb {
  margin-top: 3.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  text-align: center;
}

/* ------------------------------------------------------------ 页脚 */

.site-foot {
  margin-top: 4.5rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  color: var(--muted);
}

.foot-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 3px;
  overflow: hidden;
  opacity: 0.9;
}

.foot-seal img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.foot-text {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
}

/* 工信部备案号：底部悬挂，链接至 beian.miit.gov.cn */
.site-icp {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--muted);
}

.site-icp a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.site-icp a:hover {
  color: var(--ink-soft);
  border-bottom-color: var(--rule);
}

/* ------------------------------------------------------------ 窄屏 */

@media (max-width: 34rem) {
  body { font-size: 16px; }
  .wrap { padding: 3rem 1.15rem 3rem; }
  .entry { flex-wrap: wrap; gap: 0.35rem 0.7rem; }
  .lead { display: none; }
  .title { white-space: normal; }
  .tag-wrap { margin-left: auto; }
  /* 窄屏标题占满宽度，印章缩小避免挤在一起 */
  .seal { width: 2.75rem; height: 2.75rem; border-radius: 4px; }
}

@media print {
  body { background: #fff; }
  .wrap { max-width: none; }
  .site-foot, .crumb { display: none; }
}
