/* Writings (writings/*.html): the article pages. The header's [ Writings ]
   link opens writings/ai-design-workflow.html directly (only one article so
   far). Loaded after css/style.css, which supplies the header, contact block
   and footer.

   ---------- Adding an article ----------
   Copy writings/ai-design-workflow.html, swap the head (title, description),
   .post-head and .post-body. With more than one article, add a list page
   (not named index.html) and point the [ Writings ] links at it.
   Inside .post-body plain HTML is styled for you: h2, h3, p, ul/ol, blockquote,
   plus a few blocks carried over from the source article:
     p.out          stage-output callout (blue rule on the left)
     div.tbl>table  table on a white card (scrolls sideways on phones)
     figure         white card for an SVG/image, with figcaption
     div.flow       pill-shaped step chain (.row > .st / .op, .row.new = accent)
   Put data-reveal on every top-level block so it fades in (css/reveal.css). */

.post {
  /* Plus Jakarta Sans has no Chinese glyphs: Chinese falls through to the system's CJK face. */
  --font-text: "Plus Jakarta Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --muted: #6b6b6b;
  --line: rgba(0, 0, 0, 0.12);
  --surface: #fff;
  --on-accent: #fff;
  font-family: var(--font-text);
  margin: clamp(40px, 5.8vw, 84px) auto 0;
}

/* ---------- Back link (same look as .work-back) ---------- */
.post-back {
  display: inline-block;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: pre;
  transition: color var(--hover-dur) var(--hover-ease);
}
.post-back:hover { color: var(--accent); }

/* ---------- Article ---------- */
.post { width: min(920px, 100% - 2 * var(--gutter)); }

.post-head {
  margin-top: clamp(48px, 5.6vw, 80px);
  padding-bottom: clamp(32px, 4vw, 48px);
}
.post-title {
  font-size: 28px; /* one line on desktop; body sizes match the About page (css/about.css) */
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
/* The Chinese dash (——) is set in the CJK face so its two halves join into one line;
   Plus Jakarta Sans draws them as two separate em dashes with a gap. */
.post-title__dash { font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; font-weight: 400; }
/* Lede: the article's conclusion in two sentences, right under the title. */
.post-lede {
  margin-top: clamp(20px, 2.2vw, 28px);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.75;
  color: var(--muted);
}

/* ---------- Body copy ---------- */
.post-body {
  margin-top: clamp(40px, 4.4vw, 56px);
  font-size: 15px;
  line-height: 1.75;
}
.post-body > :first-child { margin-top: 0; }
.post-body h2 {
  margin: clamp(64px, 6.7vw, 96px) 0 0.7em; /* wide gap between article sections */
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
  text-wrap: balance;
}
.post-body h3 {
  margin: 2em 0 0.5em;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}
.post-body p { margin: 0 0 1.05em; }
/* The four stage headings sit inside one section (工作流全景), so they keep the
   original, tighter gap instead of the wide gap between sections. */
.post-body h2:has(.post-stage) { margin-top: 2.6em; }
/* Stage number above a stage heading, in place of a "阶段一：" prefix. */
.post-body .post-stage {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--accent);
}
/* Number in front of a numbered sub-heading (the four shifts: 01–04). */
.post-body .post-num {
  margin-right: 10px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
/* Key takeaway: the article's closing line, set larger, bolder and in the site blue. */
.post-body .post-key {
  margin-top: 1.6em;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--accent);
}
.post-body :is(ul, ol) {
  margin: 0 0 1.05em;
  padding-left: 1.3em;
  list-style: disc;
}
.post-body ol { list-style: decimal; }
.post-body li + li { margin-top: 0.35em; }
.post-body li::marker { color: var(--accent); }
.post-body strong { font-weight: 700; }
.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* Stage output: a short takeaway under each stage. */
.post-body .out {
  margin: 1.4em 0 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--surface);
  box-shadow: var(--tile-shadow);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.75;
}

/* ---------- Cards: tables, figures, step chains ---------- */
.post-body .tbl,
.post-body figure,
.post-body .flow {
  margin: 1.6em 0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--tile-shadow);
}

.post-body .tbl { overflow-x: auto; }
.post-body table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.7;
}
.post-body th,
.post-body td {
  padding: 12px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.post-body th {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.post-body td:first-child { font-weight: 700; white-space: nowrap; }
.post-body tbody tr:last-child td { border-bottom: 0; }
/* Before/after table (.tbl--compare): the last column is the new way, so it
   stands out in the site blue on a faint blue band; the old way steps back to grey. */
.post-body .tbl--compare td:nth-child(2) { color: var(--muted); }
.post-body .tbl--compare :is(th, td):last-child {
  background: rgba(0, 0, 255, 0.05);
  color: var(--accent);
}
.post-body .tbl--compare th:last-child { font-weight: 800; }
.post-body .tbl--compare td:last-child { font-weight: 700; }

.post-body figure { padding: clamp(16px, 2.4vw, 24px); }
.post-body figure svg { display: block; width: 100%; height: auto; font-family: var(--font-text); }
.post-body figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  color: var(--muted);
}

/* The labels and step rows are centred in the card as one group (labels stay
   left-aligned with their rows); on narrow screens the rows still wrap. */
.post-body .flow {
  display: grid;
  justify-content: center;
  padding: clamp(16px, 2.4vw, 24px);
}
.post-body .flow .lbl {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--muted);
}
.post-body .flow .row + .lbl { margin-top: 20px; }
.post-body .flow .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.post-body .flow .st {
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
}
.post-body .flow .op { padding: 0 1px; font-size: 14px; color: var(--muted); }
.post-body .flow .new .st { border-color: var(--accent); color: var(--accent); }
.post-body .flow .new .st.end { background: var(--accent); color: var(--on-accent); }

/* The article ends on the blue key line with no footer rule, so the robot gets
   extra room above it to separate it from the text. */
.post ~ .motto--bot-only { margin-top: clamp(160px, 30.56vw, 440px); } /* 440px at 1440 wide */

@media (max-width: 767px) {
  .post-body th,
  .post-body td { padding: 10px 14px; }
}
