/* myblogos 静态站点 —— 暖白纸感 / 墨黑正文 / 铜色点缀。
   设计取舍：不用蓝色系（用户明确嫌丑），用近黑 + 暖灰 + 一点铜色做层级；
   列表去掉卡片堆叠感，靠留白与细线分区，长时间阅读不累。 */
:root {
  --paper: #f6f3ed;
  --sheet: #fffdf8;
  --ink: #23201c;
  --ink-soft: #514c45;
  --muted: #8a8176;
  --line: #e6dfd3;
  --accent: #a8562f;
  --accent-soft: #f0e2d8;
  --code-bg: #27231f;
  --code-fg: #f3ece1;
  --maxw: 860px;
  --serif: Georgia, "Songti SC", "Noto Serif CJK SC", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

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

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

header.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: saturate(130%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 15px 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.site-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.site-title a { color: var(--ink); }
.site-title a:hover { color: var(--accent); }
.site-nav { display: flex; gap: 24px; align-items: center; }
.site-nav a {
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--accent); }
.social-icons { display: flex; gap: 15px; align-items: center; justify-content: flex-end; }
.social-icons a {
  display: inline-flex;
  color: var(--ink-soft);
  opacity: 0.78;
  transition: color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}
.social-icons a:hover { color: var(--accent); opacity: 1; transform: translateY(-1px); }

.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }

/* 语言滑动开关：像拨杆一样左右拉，滑块跟手；点两侧/方向键同样可切。
   尺寸 86×32、内边距 3、边框 1 → 每半 39px，与内联脚本的 travel 保持一致。 */
.lang-switch {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  width: 86px; height: 32px; padding: 3px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--accent-soft);
  cursor: grab; touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.lang-switch:active { cursor: grabbing; }
.lang-switch:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-thumb {
  position: absolute; left: 3px; top: 3px;
  width: 39px; height: 24px; border-radius: 999px;
  background: var(--sheet);
  box-shadow: 0 1px 4px rgba(35, 32, 28, 0.18);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.25, 1);
  pointer-events: none;
}
.lang-switch[data-current="en"] .lang-thumb { transform: translateX(39px); }
.lang-opt {
  position: relative; z-index: 1;
  border: 0; padding: 0; background: transparent;
  font-family: inherit; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; line-height: 24px;
  color: var(--muted); cursor: pointer;
  transition: color 0.18s ease;
}
.lang-opt.active { color: var(--ink); }
.lang-switch:hover .lang-opt:not(.active) { color: var(--ink-soft); }

main.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 54px 28px 90px;
}

/* ---- 首页 ---- */
.hero { max-width: 720px; margin: 0 auto 64px; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  font-weight: 600;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5.2vw, 54px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  font-weight: 600;
}
.hero .lede { color: var(--ink-soft); font-size: 17px; margin: 0; }

.post-list { max-width: 760px; margin: 0 auto; scroll-margin-top: 90px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 10px;
  margin-bottom: 4px;
}
.section-head h2 { font-family: var(--serif); font-size: 20px; margin: 0; font-weight: 600; }
.section-head .count { font-size: 12px; color: var(--muted); }
.post-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 22px;
  padding: 24px 4px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.post-row:hover { background: rgba(255, 253, 248, 0.7); }
.post-row time {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 5px;
  letter-spacing: 0.02em;
}
.post-info h3 {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.4;
  margin: 0 0 6px;
  font-weight: 600;
}
.post-info h3 a::after { content: " ↗"; font-family: var(--sans); font-size: 13px; color: var(--muted); opacity: 0; transition: opacity 0.15s ease; }
.post-row:hover .post-info h3 a { color: var(--accent); }
.post-row:hover .post-info h3 a::after { opacity: 1; }
.post-info .excerpt { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.empty-note { color: var(--muted); padding: 36px 0; }

/* ---- 文章页 ---- */
.prose { max-width: 760px; margin: 0 auto; }
.post-head { border-bottom: 1px solid var(--line); padding-bottom: 28px; margin-bottom: 36px; }
.post-head h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 42px);
  line-height: 1.28;
  margin: 0 0 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.post-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.post-meta time { font-variant-numeric: tabular-nums; }
.post-meta .sep { opacity: 0.5; }
.prose-body { font-size: 16.5px; line-height: 1.85; }
.prose-body h2 { font-family: var(--serif); font-size: 25px; margin: 44px 0 14px; padding-top: 8px; }
.prose-body h3 { font-family: var(--serif); font-size: 20px; margin: 32px 0 10px; }
.prose-body h4 { font-size: 17px; margin: 26px 0 8px; }
.prose-body p { margin: 0 0 20px; }
.prose-body img { max-width: 100%; border-radius: 10px; display: block; margin: 24px auto; }
.prose-body hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.prose-body ul, .prose-body ol { padding-left: 24px; margin: 0 0 22px; }
.prose-body li { margin-bottom: 6px; }
.prose-body a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 3px; }
.prose-body a:hover { text-decoration-color: var(--accent); }

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  margin: 24px 0;
}
code { font-family: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace; font-size: 0.9em; }
:not(pre) > code {
  background: var(--accent-soft);
  color: #7b3d20;
  padding: 2px 6px;
  border-radius: 5px;
}
blockquote {
  border-left: 3px solid var(--accent);
  background: var(--sheet);
  margin: 24px 0;
  padding: 12px 20px;
  color: var(--ink-soft);
  border-radius: 0 8px 8px 0;
}
blockquote p:last-child { margin-bottom: 0; }

table { border-collapse: collapse; width: 100%; margin: 24px 0; font-size: 14px; }
th, td { border: 1px solid var(--line); padding: 9px 13px; text-align: left; }
th { background: var(--sheet); font-weight: 600; }

/* Mermaid 图放在纸感卡片里：居中、允许横向滚动，长图不撑破正文栏宽。 */
.mermaid {
  margin: 28px 0;
  padding: 24px 18px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  overflow-x: auto;
}
.mermaid svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }

sup.citation a { font-size: 0.75em; margin-left: 2px; }
section.references { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--ink); }
section.references h2 { font-family: var(--serif); font-size: 19px; }
section.references ol { padding-left: 22px; }
section.references li { margin-bottom: 10px; font-size: 13.5px; color: var(--ink-soft); }
section.references pre { font-size: 12.5px; }
.post-nav { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; }
.post-nav a { color: var(--muted); }
.post-nav a:hover { color: var(--accent); }

footer.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 28px 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  /* 三列网格：版权永远居中，RSS 等附项靠右；没有附项时版权也不跑偏。 */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.footer-copy { grid-column: 2; }
.footer-links { grid-column: 3; display: flex; gap: 16px; justify-self: end; }

@media (max-width: 720px) {
  .header-inner { grid-template-columns: 1fr auto; padding: 13px 18px; gap: 10px; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; gap: 18px; padding-top: 8px; border-top: 1px solid var(--line); }
  .header-actions { grid-column: 2; grid-row: 1; gap: 10px; }
  main.container { padding: 38px 18px 64px; }
  .post-row { grid-template-columns: 1fr; gap: 4px; padding: 20px 2px; }
  .post-row time { padding-top: 0; }
  footer.site-footer { padding: 22px 18px 36px; grid-template-columns: 1fr; gap: 10px; }
  footer.site-footer .footer-copy,
  footer.site-footer .footer-links { grid-column: 1; }
  .footer-links { justify-self: center; }
}
