/* ==========================================================================
   Shared page layer for text pages (FAQ, identity).
   Base tokens and typography come from home.css; only page-specific blocks
   live here. Add another body class when a page needs its own rhythm.
   ========================================================================== */

/* The language bar on text pages is plain text, not the icon toolbar. */
.langbar {
  display: block;
  text-align: right;
  margin-bottom: 34px;
}

.langbar a,
.langbar .cur {
  margin-left: 14px;
  color: var(--ink-faint);
  border-bottom: none;
}

.langbar a:hover { color: var(--celadon-deep); border-bottom: none; }
.langbar .cur { color: var(--ink); font-weight: 600; }

/* Quiet notice box, same shape as the homepage note. */
.notice {
  margin: 2em 0;
  padding: 18px 22px;
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  border-left: 2px solid var(--celadon);
  border-radius: var(--radius);
  color: var(--note-ink);
  font-size: .91rem;
  line-height: 1.75;
}

.notice b,
.notice strong { color: var(--ink-strong); }

.hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.2em 0;
}

/* FAQ: question headings are quiet ruled lines, answers sit on the page. */
body.faq h3 {
  margin: 2.6em 0 0;
  padding: 0 0 .72em;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  color: var(--ink-strong);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.72;
  scroll-margin-top: 18px;
}

body.faq h3 .date {
  display: inline-block;
  margin-left: .7em;
  padding: 1px 7px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--ink-faint);
  font-size: .7rem;
  font-weight: 400;
  line-height: 1.65;
  vertical-align: middle;
}

body.faq .a {
  margin: 0 0 12px;
  padding: 14px 0 4px;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--ink);
}

body.faq .a p { margin: 0 0 1.15em; }
body.faq .a p:last-child { margin-bottom: 0; }

body.faq .a.clamp { position: relative; overflow: hidden; }
body.faq .a.clamp::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.4em;
  background: linear-gradient(rgba(247, 244, 236, 0), var(--paper) 80%);
  pointer-events: none;
}

body.faq .a.zh,
body.faq h3.zh { color: var(--ink); }

body.faq .qa-toggle {
  display: inline-block;
  margin: -.2em 0 1.4em 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--celadon-deep);
  font: inherit;
  font-size: .78rem;
  line-height: 1.7;
  letter-spacing: .03em;
  cursor: pointer;
}

body.faq .qa-toggle:hover {
  color: var(--ochre);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.faq .qa-toggle:focus-visible {
  outline: 1px solid var(--celadon);
  outline-offset: 3px;
}

/* Contents card */
.toc {
  margin: 2.4em 0 1em;
  padding: 20px 24px 22px;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.toc-title {
  margin: 0 0 12px;
  color: var(--ink-faint);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .16em;
}

.toc-cols {
  display: flex;
  gap: 32px;
}

.toc-cols > div { flex: 1; min-width: 0; }

.toc-lang {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
}

.toc ul { margin: 0; padding-left: 1.3em; }
.toc li { margin: .3em 0; font-size: .84rem; line-height: 1.6; }
.toc a { border-bottom: none; }
.toc a:hover { border-bottom: 1px solid var(--ochre); }

.toc.collapsed .toc-cols li:nth-child(n+7) { display: none; }

.toc-toggle {
  display: block;
  margin: 14px auto 0;
  padding: 5px 14px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font: inherit;
  font-size: .76rem;
  line-height: 1.6;
  cursor: pointer;
}

.toc-toggle:hover {
  color: var(--ochre);
  border-color: var(--ochre);
}

.toc-toggle:focus-visible {
  outline: 1px solid var(--celadon);
  outline-offset: 2px;
}

/* Identity page keeps its Chinese/English sections visually equal. */
body.identity .zh { color: var(--ink); }

@media (max-width: 640px) {
  .langbar { margin-bottom: 28px; }
  .toc-cols { flex-direction: column; gap: 14px; }
  .toc.collapsed .toc-cols li:nth-child(n+5) { display: none; }
  body.faq h3 { font-size: .98rem; padding-bottom: .6em; }
  body.faq .a { padding-top: 12px; }
  body.faq .qa-toggle { margin-bottom: 1.2em; }
}
