/* ===== 4myown.com · 黑白精修 ===== */
:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --ink: #111111;
  --ink-2: #525252;
  --ink-3: #8c8c8c;
  --line: #e6e6e6;
  --line-soft: #f0f0f0;
  --code-bg: #f5f5f5;
  --card-shadow: 0 8px 26px rgba(17, 17, 17, .08);
  --nav-bg: rgba(255, 255, 255, .86);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101012;
    --bg-soft: #17171a;
    --ink: #e9e9e7;
    --ink-2: #a6a6a2;
    --ink-3: #767671;
    --line: #2b2b2e;
    --line-soft: #212124;
    --code-bg: #1a1a1d;
    --card-shadow: 0 8px 26px rgba(0, 0, 0, .5);
    --nav-bg: rgba(16, 16, 18, .86);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 700; }

a { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 28%, transparent); text-underline-offset: 3px; transition: text-decoration-color .2s var(--ease); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 1px; }
::selection { background: var(--ink); color: var(--bg); }

/* ---- 顶部导航：sticky + 毛玻璃 ---- */
.site-nav {
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}
.site-nav .inner {
  max-width: 780px; margin: 0 auto; padding: 15px 22px;
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px;
}
.site-nav .brand {
  font-family: var(--serif); font-size: 19px; font-weight: 700;
  text-decoration: none; letter-spacing: .05em;
}
.site-nav .brand::after { content: "."; margin-left: 1px; color: var(--ink-3); }
.site-nav .links a {
  margin-left: 18px; font-size: 14px; color: var(--ink-2); text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 1px;
  padding-bottom: 2px; transition: color .2s var(--ease), background-size .28s var(--ease);
}
.site-nav .links a:hover { color: var(--ink); background-size: 100% 1px; }

.page { max-width: 700px; margin: 0 auto; padding: 44px 22px 28px; }

/* ---- 入场动画 ---- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.hero, .post-header, .module-cards, .post-list { animation: rise .55s var(--ease) both; }
.post-list { animation-delay: .08s; }

/* ---- 首页 hero ---- */
.hero { padding: 26px 0 6px; }
.hero .kicker {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .32em;
  color: var(--ink-3); margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(34px, 6.5vw, 46px); margin: 0 0 14px;
  letter-spacing: .08em; line-height: 1.15; font-weight: 700;
}
.hero p { color: var(--ink-2); margin: 0; font-size: 16.5px; }

/* ---- 文章列表 ---- */
.post-list { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid var(--line); }
.post-list li { border-bottom: 1px solid var(--line); }
.post-list a {
  display: block; padding: 20px 14px 19px; text-decoration: none;
  margin: 0 -14px; border-radius: 4px;
  transition: background .22s var(--ease);
}
.post-list a:hover { background: var(--bg-soft); }
.post-meta-line {
  display: block; font-family: var(--mono); font-size: 12px;
  color: var(--ink-3); letter-spacing: .06em; margin-bottom: 7px;
}
.post-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.45;
  transition: color .2s var(--ease);
}
.post-title .arrow {
  font-family: var(--sans); font-weight: 400; font-size: 17px; color: var(--ink-3);
  opacity: 0; transform: translateX(-8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.post-list a:hover .arrow, .post-list a:focus-visible .arrow { opacity: 1; transform: none; }
.post-desc { display: block; font-size: 14px; color: var(--ink-2); margin-top: 6px; line-height: 1.7; }

/* ---- 备考资料库 ---- */
.section-title {
  display: flex; align-items: center; gap: 14px;
  font-size: 12px; color: var(--ink-3); letter-spacing: .4em;
  font-family: var(--sans); margin: 46px 0 0; white-space: nowrap;
}
.section-title::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.module-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.module-card {
  position: relative; border: 1px solid var(--line); border-radius: 5px;
  padding: 20px 20px 17px; text-decoration: none; display: block; overflow: hidden;
  transition: border-color .22s var(--ease), transform .22s var(--ease), box-shadow .22s var(--ease);
}
.module-card:hover {
  border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--card-shadow);
}
.module-card .card-kicker {
  display: block; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .22em; color: var(--ink-3); margin-bottom: 9px;
}
.module-card h3 { margin: 0 0 6px; font-size: 17.5px; letter-spacing: .02em; }
.module-card p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }
.module-card .card-arrow {
  position: absolute; top: 16px; right: 16px; font-size: 15px; color: var(--ink-3);
  opacity: 0; transform: translate(-4px, 4px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), color .2s;
}
.module-card:hover .card-arrow { opacity: 1; transform: none; color: var(--ink); }
@media (max-width: 560px) {
  .module-cards { grid-template-columns: 1fr; }
  .post-title { font-size: 18.5px; }
}

/* ---- 文章页 ---- */
.post-header { margin: 16px 0 0; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.post-header h1 { font-size: clamp(25px, 4.6vw, 33px); line-height: 1.42; margin: 0 0 15px; letter-spacing: .02em; }
.post-header .meta { font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); letter-spacing: .04em; }
.tag {
  display: inline-block; font-size: 11.5px; color: var(--ink-2); font-family: var(--sans);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 10px; margin: 0 0 0 7px; line-height: 19px; letter-spacing: .04em;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.tag:hover { border-color: var(--ink); color: var(--ink); }

.post-body { font-size: 16.5px; line-height: 1.88; }
.post-body > :first-child { margin-top: 30px; }
.post-body h2 { font-size: 21.5px; margin: 1.9em 0 .6em; letter-spacing: .02em; }
.post-body h3 { font-size: 17.5px; margin: 1.6em 0 .5em; }
.post-body h2 a.toclink, .post-body h3 a.toclink { text-decoration: none; color: inherit; }
.post-body p { margin: 1em 0; }
.post-body ul, .post-body ol { padding-left: 1.5em; margin: 1em 0; }
.post-body li { margin: .35em 0; }
.post-body li::marker { color: var(--ink-3); }
.post-body blockquote {
  border-left: 2px solid var(--ink); margin: 1.4em 0;
  padding: .1em 0 .1em 20px; color: var(--ink-2);
}
.post-body pre {
  background: var(--code-bg); border: 1px solid var(--line);
  padding: 14px 16px; overflow-x: auto; border-radius: 4px;
  font-size: 13.5px; line-height: 1.65;
}
.post-body code { font-family: var(--mono); background: var(--code-bg); padding: 2px 6px; border-radius: 3px; font-size: .87em; }
.post-body pre code { background: none; padding: 0; font-size: inherit; }
.post-body table { border-collapse: collapse; width: 100%; margin: 1.3em 0; font-size: 14.5px; display: block; overflow-x: auto; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; }
.post-body th { background: var(--bg-soft); font-family: var(--sans); font-weight: 600; }
.post-body img { max-width: 100%; border-radius: 3px; }
.post-body hr { border: 0; text-align: center; margin: 2.4em 0; }
.post-body hr::after { content: "·　·　·"; color: var(--ink-3); letter-spacing: .4em; font-size: 14px; }

.back { margin-top: 52px; border-top: 1px solid var(--line); padding-top: 18px; font-size: 14px; }
.back a { text-decoration: none; color: var(--ink-2); transition: color .2s var(--ease); }
.back a:hover { color: var(--ink); }

/* ---- 页脚 ---- */
.site-footer {
  max-width: 780px; margin: 40px auto 0; padding: 20px 22px 30px;
  border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 12px; font-family: var(--mono); letter-spacing: .05em;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px;
}

/* ---- 打印 ---- */
@media print {
  .site-nav, .site-footer, .back { display: none; }
  body { font-size: 12pt; }
  .page { padding: 0; }
}

/* ---- 动效降级 ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
