/* 工程塑料学习笔记 · shared stylesheet (static site, no scripts) */
:root {
  --bg: #fbfaf7; --panel: #ffffff; --fg: #23211d; --muted: #6f6a62; --rule: #e4e0d8;
  --head: #f3f0e9; --accent: #8a5a2b; --accent-soft: #f4ebe0; --tag: #ece6db;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513; --panel: #1d1c19; --fg: #e9e6df; --muted: #9a958c; --rule: #2e2c27;
    --head: #23211e; --accent: #d39a5c; --accent-soft: #2b2219; --tag: #2a2823;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.75 -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header */
.site-head { border-bottom: 1px solid var(--rule); background: var(--panel); }
.site-head .in { max-width: 68rem; margin: 0 auto; padding: .9rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; }
.brand { color: var(--fg); font: 600 1.15rem/1.3 Georgia, "Songti SC", "SimSun", serif; letter-spacing: .02em; }
.brand small { display: block; color: var(--muted); font: 12px/1.4 -apple-system, "Segoe UI", sans-serif; letter-spacing: 0; }
.brand:hover { text-decoration: none; }
nav.main { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-left: auto; font-size: 14px; }
nav.main a { color: var(--muted); padding: .2rem 0; border-bottom: 2px solid transparent; }
nav.main a:hover { color: var(--fg); text-decoration: none; }
nav.main a.on { color: var(--fg); border-bottom-color: var(--accent); }

/* layout */
main { max-width: 68rem; margin: 0 auto; padding: 2rem 1rem 3.5rem; }
main.narrow { max-width: 46rem; }
h1 { font: normal 1.7rem/1.35 Georgia, "Songti SC", "SimSun", serif; margin: .3rem 0 .4rem; }
h2 { font: normal 1.2rem/1.4 Georgia, "Songti SC", "SimSun", serif; margin: 2.2rem 0 .7rem; padding-bottom: .3rem; border-bottom: 1px solid var(--rule); }
h3 { font-size: 1rem; margin: 1.6rem 0 .4rem; }
p { margin: .6rem 0; }
.lead { color: var(--muted); margin: 0 0 1.4rem; }
.crumb { color: var(--muted); font-size: 13px; }
.crumb a { color: var(--muted); }
.meta { color: var(--muted); font-size: 13px; }
.note { color: var(--muted); font-size: 13px; }
ul, ol { padding-left: 1.3rem; }
li { margin: .2rem 0; }

/* home */
.hero { background: var(--accent-soft); border: 1px solid var(--rule); border-radius: 8px; padding: 1.4rem 1.4rem 1.2rem; margin-bottom: 1.6rem; }
.hero h1 { margin-top: 0; }
.stats { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; margin-top: .8rem; font-size: 13px; color: var(--muted); }
.stats b { color: var(--fg); font-size: 1.15rem; font-weight: 600; margin-right: .2rem; font-variant-numeric: tabular-nums; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .9rem; }
.card { display: block; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem; color: var(--fg); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card b { display: block; font-size: 15px; margin-bottom: .2rem; }
.card span { color: var(--muted); font-size: 13px; line-height: 1.6; }

/* lists of notes */
ul.posts { list-style: none; padding: 0; margin: 0; }
ul.posts li { padding: .75rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
ul.posts li:last-child { border-bottom: 0; }
ul.posts a { font-weight: 600; }
ul.posts p { margin: .15rem 0 0; color: var(--muted); font-size: 13.5px; }
.tag { display: inline-block; background: var(--tag); color: var(--muted); border-radius: 3px; padding: 0 .4rem; font-size: 12px; margin-right: .3rem; }

/* tables */
.wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.wide { min-width: 58rem; }
th, td { padding: .45rem .6rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
th { background: var(--head); font-weight: 600; white-space: nowrap; }
td.n { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.m { font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* article */
article p, article li { text-align: justify; }
.box { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: .6rem .9rem; margin: 1rem 0; font-size: 14px; }
dl.terms dt { font-weight: 600; margin-top: 1rem; }
dl.terms dd { margin: .15rem 0 0 0; color: var(--fg); }
.toc { font-size: 14px; columns: 2 14rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: 14px; }

/* footer */
.site-foot { border-top: 1px solid var(--rule); color: var(--muted); font-size: 13px; }
.site-foot .in { max-width: 68rem; margin: 0 auto; padding: 1.2rem 1rem 2rem; text-align: center; line-height: 1.9; }
.site-foot a { color: var(--muted); }

@media (max-width: 40rem) {
  body { font-size: 15px; }
  h1 { font-size: 1.45rem; }
  nav.main { margin-left: 0; width: 100%; }
  .hero { padding: 1.1rem 1rem 1rem; }
}
