/* Shared reading styles for the app and standalone technical articles. */
.pm-knowledge,
.pm-reference,
.pm-article-page {
  --pm-ink: #172337;
  --pm-muted: #526176;
  --pm-rule: #dce3ec;
  font-family: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  overflow-wrap: anywhere;
}

.pm-knowledge { width: 100%; min-width: 0; }
.pm-reference { width: 100%; min-width: 0; max-width: 64rem; margin-inline: auto; }
.pm-intro { font-size: 1rem; line-height: 1.9; }
.pm-page-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; line-height: 1.45; text-wrap: pretty; }
.pm-reader { max-width: 56rem; margin-inline: auto; scroll-margin-top: 5rem; }
.pm-reader-title { font-size: clamp(1.625rem, 3vw, 2.125rem); line-height: 1.5; font-weight: 800; text-wrap: pretty; }
.pm-reader-body { max-width: 44rem; margin-inline: auto; font-size: 1rem; line-height: 1.95; color: var(--pm-ink); }
.pm-reader-body section + section { margin-top: 2.5rem; }
.pm-reader-body section { scroll-margin-top: 6rem; }
.pm-reader-body h3 { margin-bottom: 1rem; padding-left: 1rem; border-left: 4px solid #2563eb; font-size: 1.25rem; font-weight: 750; line-height: 1.6; }
.pm-reader-body p + p { margin-top: 1.25rem; }
.pm-reader-summary { padding: 1rem 1.25rem; border-left: 3px solid #2563eb; background: #eff6ff; border-radius: 0 .75rem .75rem 0; font-size: 1rem; line-height: 1.9; color: #334155; }
.pm-article-card { min-width: 0; padding: 1.5rem; }
.pm-article-card h3 { font-size: 1.125rem; line-height: 1.65; text-wrap: pretty; }
.pm-article-card p { font-size: .9375rem; line-height: 1.85; }
.pm-meta { font-size: .8125rem; line-height: 1.7; }
.pm-toc { border: 1px solid var(--pm-rule); border-radius: .75rem; background: #f8fafc; padding: 1rem 1.25rem; }
.pm-toc a { display: block; padding-block: .625rem; font-size: .9375rem; line-height: 1.6; color: #1d4ed8; text-decoration: underline; text-underline-offset: .2em; }
.pm-source { font-size: .875rem; line-height: 1.85; }
.pm-knowledge :is(button, input),
.pm-reference button { min-height: 44px; }
.pm-knowledge :is(button, a, input):focus-visible,
.pm-reference :is(button, a, input):focus-visible,
.pm-table-scroll:focus-visible,
.pm-formula:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.pm-knowledge input { font-size: 1rem; }
.pm-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--pm-rule); border-radius: .75rem; }
.pm-table-scroll table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.8; }
.pm-table-scroll :is(th, td) { padding: .875rem 1rem; vertical-align: top; }
.pm-table-scroll th { font-weight: 700; }
.pm-table-scroll tbody tr:nth-child(even) { background-color: #f8fafc; }
.pm-formula { max-width: 100%; overflow-x: auto; white-space: nowrap; padding: 1rem; border-radius: .75rem; background: #0f172a; color: #fde68a; font-size: .9375rem; line-height: 1.9; }
.pm-answer { font-size: 1rem; line-height: 1.95; color: #334155; }
.pm-answer > * + * { margin-top: 1rem; }
.pm-answer p { font-size: inherit; line-height: inherit; }
.pm-answer .pm-source { font-size: .875rem; }
.pm-note { font-size: .9375rem; line-height: 1.9; }

/* Standalone articles use the same measure and typography as the in-app reader. */
.pm-article-page main { max-width: 56rem; }
.pm-article-page article > section { max-width: 44rem; margin-inline: auto; margin-top: 2.75rem; font-size: 1.0625rem; line-height: 1.95; }
.pm-article-page article > section h2 { font-size: 1.375rem; line-height: 1.6; margin-bottom: 1.25rem; }
.pm-article-page article > section h3 { font-size: 1.125rem; margin-top: 1.75rem; }
.pm-article-page article > section p { margin-block: 1rem; }
.pm-article-page .source { font-size: .875rem; line-height: 1.85; }
.pm-article-page .table-hint { display: none; font-size: .875rem; color: #526176; margin-bottom: .5rem; }
.pm-article-page .pm-table-scroll table { min-width: 32rem; table-layout: auto; }
.pm-article-page .pm-table-scroll caption { padding: .75rem 1rem; margin: 0; background: #f8fafc; }
.pm-article-page .pm-table-scroll th[scope="row"] { min-width: 8rem; }
.pm-article-page .toc { margin-top: 1.5rem; }
.pm-article-page footer { font-size: .875rem; line-height: 1.85; }

@media (min-width: 640px) {
  .pm-reader-body { font-size: 1.0625rem; }
}
@media (max-width: 600px) {
  .pm-article-card { padding: 1.25rem; }
  .pm-table-scroll :is(th, td) { padding: .75rem; }
  .pm-article-page article > section { font-size: 1rem; }
  .pm-article-page .hero { padding: 1.5rem 1.25rem; }
  .pm-article-page .table-hint { display: block; }
  .pm-article-page .pm-table-scroll :is(th, td) { font-size: .9375rem; }
}
@media print {
  .pm-reader .pm-reader-header { display: block !important; }
  .pm-reader .pm-toc { display: none !important; }
  .pm-reader { border: 0; box-shadow: none; padding: 0; }
  .pm-reader-body { max-width: none; }
  .pm-reader-body section { break-inside: avoid; }
  .pm-table-scroll, .pm-formula { overflow: visible; }
  .pm-article-page .pm-table-scroll table { min-width: 0; }
  .pm-article-page .table-hint { display: none; }
}
