@charset "utf-8";

/* ==========================================================================
 * Academic Monograph Article Core (hexo-theme-mashiro + typo accents)
 * ========================================================================== */
.article-wrap {
  max-width: var(--measure);
  margin: 0 auto;
}

.article-header {
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.article-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.article-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.24;
  color: var(--ink);
  margin-bottom: 12px;
}

.article-subtitle {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-style: italic;
  color: var(--ink-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

/* ==========================================================================
 * Table of Contents (Mashiro scholarly TOC)
 * ========================================================================== */
#article-toc {
  margin: 0 0 32px;
  padding: 16px 20px;
  border-left: 2px solid var(--border-strong);
  background-color: var(--bg-subtle);
  font-family: var(--font-serif);
  font-size: 0.94rem;
}

#article-toc .toc-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

#article-toc ol,
#article-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#article-toc .toc-child {
  padding-left: 18px;
  margin-top: 4px;
}

#article-toc .toc-item {
  line-height: 1.55;
  margin-bottom: 4px;
}

#article-toc .toc-link {
  color: var(--ink-secondary);
  text-decoration: none;
  padding-bottom: 1px;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 50% 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: color 0.2s ease, background-size 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

#article-toc .toc-link:hover,
#article-toc .toc-link:focus-visible {
  color: var(--ink);
  text-decoration: none;
  background-size: 100% 1px;
}

#article-toc .toc-number {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--ink-muted);
  margin-right: 6px;
}

/* ==========================================================================
 * Article Body Typography (Latin Modern + CTeX Booktabs + Math + Biaodian)
 * ========================================================================== */
.article-entry {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  line-height: 1.76;
  color: var(--ink-body);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (min-width: 640px) {
  .article-entry p {
    text-align: justify;
    -webkit-hyphens: auto;
    hyphens: auto;
  }
}

.article-entry > :first-child {
  margin-top: 0;
}

.article-entry > :last-child {
  margin-bottom: 0;
}

.article-entry p {
  margin-bottom: 1.15em;
}

.article-entry a {
  color: var(--link);
  text-decoration: none;
  padding-bottom: 1px;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 50% 100%;
  background-repeat: no-repeat;
  background-size: 0% 1.25px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: color 0.2s ease, background-size 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.article-entry a:hover,
.article-entry a:focus-visible {
  color: var(--link-hover);
  text-decoration: none;
  background-size: 100% 1.25px;
}

.article-entry a.lightbox-trigger {
  background-image: none;
  padding-bottom: 0;
}

.article-entry strong {
  font-weight: 700;
  color: var(--ink);
}

.article-entry em,
.article-entry cite {
  font-style: italic;
}

.article-entry small {
  font-size: 0.86em;
  color: var(--ink-secondary);
}

/* Headings */
.article-entry h1,
.article-entry h2,
.article-entry h3,
.article-entry h4,
.article-entry h5,
.article-entry h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin-top: 2em;
  margin-bottom: 0.7em;
}

.article-entry h1 { font-size: 1.75rem; }
.article-entry h2 { font-size: 1.42rem; }
.article-entry h3 { font-size: 1.2rem; }
.article-entry h4 { font-size: 1.06rem; }
.article-entry h5 { font-size: 0.98rem; }
.article-entry h6 { font-size: 0.92rem; color: var(--ink-secondary); }

/* Typo signature ⌗ heading marker when NOT using LaTeX section numbering */
.article-entry:not(.article-with-titlenum) h2::before,
.article-entry:not(.article-with-titlenum) h3::before {
  content: "⌗";
  color: var(--hashtag);
  font-weight: 400;
  font-size: 0.88em;
  margin-right: 8px;
}

/* Mashiro automatic LaTeX section numbering (1, 1.1, 1.1.1) */
.article-with-titlenum {
  counter-reset: sec-h2;
}

.article-with-titlenum h2 {
  counter-reset: sec-h3;
}

.article-with-titlenum h2::before {
  counter-increment: sec-h2;
  content: counter(sec-h2);
  font-family: var(--font-serif);
  padding-right: 0.85em;
  color: var(--ink-muted);
}

.article-with-titlenum h3 {
  counter-reset: sec-h4;
}

.article-with-titlenum h3::before {
  counter-increment: sec-h3;
  content: counter(sec-h2) "." counter(sec-h3);
  padding-right: 0.85em;
  color: var(--ink-muted);
}

.article-with-titlenum h4 {
  counter-reset: sec-h5;
}

.article-with-titlenum h4::before {
  counter-increment: sec-h4;
  content: counter(sec-h2) "." counter(sec-h3) "." counter(sec-h4);
  padding-right: 0.85em;
  color: var(--ink-muted);
}

.article-with-titlenum h5::before {
  counter-increment: sec-h5;
  content: counter(sec-h2) "." counter(sec-h3) "." counter(sec-h4) "." counter(sec-h5);
  padding-right: 0.85em;
  color: var(--ink-muted);
}

/* Lists */
.article-entry ul,
.article-entry ol {
  margin: 0.7em 0 1.2em;
  padding-left: 1.75em;
}

.article-entry li {
  margin-bottom: 0.35em;
}

.article-entry li > p {
  margin-bottom: 0.5em;
}

.article-entry ul:has(li > input[type="checkbox"]) {
  list-style: none;
  padding-left: 0;
}

.article-entry input[type="checkbox"] {
  margin-right: 0.5em;
}

/* Horizontal rules (Typo dashed divider) */
.article-entry hr {
  border: 0;
  border-bottom: 1px dashed var(--border);
  margin: 2em 0;
}

/* Blockquotes (Mashiro print italic OR grey GitHub style) */
.article-entry blockquote {
  margin: 1.4em 0;
  padding: 0.35em 1.4em;
  border-left: 2px solid var(--border-strong);
  color: var(--ink-refer);
}

.blockquote-italic .article-entry blockquote {
  font-style: italic;
  background: transparent;
}

.blockquote-italic .article-entry blockquote strong {
  font-style: normal;
}

.blockquote-grey .article-entry blockquote {
  font-style: normal;
  border-left-width: 4px;
  border-left-color: var(--border);
  background-color: var(--bg-quote);
  padding: 0.75em 1.4em;
}

.article-entry blockquote > :last-child {
  margin-bottom: 0;
}

/* ==========================================================================
 * LaTeX Booktabs Three-Line Tables (Signature hexo-theme-mashiro craft)
 * ========================================================================== */
.article-entry .table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.6em 0;
}

.article-entry table:not(.highlight table) {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 1.6em 0;
  border-top: 1.5px solid var(--border-strong);
  border-bottom: 1.5px solid var(--border-strong);
  font-size: 0.94rem;
  line-height: 1.55;
}

.article-entry .table-wrap table {
  margin: 0;
}

.article-entry table:not(.highlight table) thead th {
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--border-strong);
  padding: 10px 12px;
  text-align: left;
  vertical-align: bottom;
}

.article-entry table:not(.highlight table) td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.article-entry table:not(.highlight table) tbody tr:last-child td {
  border-bottom: none;
}

/* Survey proportion bar (restrained academic figure in monochrome ink) */
.survey-figure {
  margin: 1.6em 0;
  padding: 16px 18px;
  border-top: 1.5px solid var(--border-strong);
  border-bottom: 1.5px solid var(--border-strong);
  background-color: var(--bg-subtle);
}

.survey-figure-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.survey-figure-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}

.survey-figure-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.survey-bar-row {
  display: grid;
  grid-template-columns: 92px 1fr 82px;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.survey-bar-label {
  font-family: var(--font-ui);
  color: var(--ink-body);
}

.survey-bar-track {
  height: 10px;
  background-color: var(--border-subtle);
  border: 1px solid var(--border);
  overflow: hidden;
}

.survey-bar-fill {
  height: 100%;
  background-color: var(--ink);
}

.survey-bar-fill.is-mid {
  background-color: var(--ink-muted);
}

.survey-bar-fill.is-light {
  background-color: var(--border-strong);
  opacity: 0.45;
}

.survey-bar-val {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-secondary);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.survey-figure-note {
  margin-top: 12px;
  font-size: 0.84rem;
  font-style: italic;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* Academic Scope / Editorial Note callout */
.editorial-note {
  margin: 1.4em 0;
  padding: 12px 16px;
  border-left: 2px solid var(--border-strong);
  background-color: var(--bg-subtle);
  font-size: 0.92rem;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.editorial-note strong {
  color: var(--ink);
}

/* Research Stage Key (4-column booktabs legend replacing prose disclaimer) */
.stage-legend {
  margin: 0 0 36px;
  border-top: 1.5px solid var(--border-strong);
  border-bottom: 1.5px solid var(--border-strong);
  background-color: var(--bg-subtle);
}

.stage-legend-header {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.stage-legend-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stage-legend-item {
  padding: 12px 14px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stage-legend-item:last-child {
  border-right: none;
}

.stage-legend-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
}

.stage-legend-desc {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink-secondary);
}

@media (max-width: 680px) {
  .stage-legend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-legend-item:nth-child(2) {
    border-right: none;
  }

  .stage-legend-item:nth-child(1),
  .stage-legend-item:nth-child(2) {
    border-bottom: 1px solid var(--border-subtle);
  }
}

@media (max-width: 440px) {
  .stage-legend-grid {
    grid-template-columns: 1fr;
  }

  .stage-legend-item {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .stage-legend-item:last-child {
    border-bottom: none;
  }
}

/* Research Dossiers Section & Compact Definition Lists (Background) */
.dossiers-section {
  margin-bottom: 40px;
  padding-bottom: 36px;
  border-bottom: 1px dashed var(--border);
}

.dossiers-heading {
  font-family: var(--font-serif);
  font-size: 1.42rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 22px;
}

.dossiers-heading::before {
  content: "⌗";
  color: var(--hashtag);
  font-weight: 400;
  font-size: 0.88em;
  margin-right: 8px;
}

.article-entry .profile-dl {
  margin: 1.2em 0 1.4em;
  border-top: 1.5px solid var(--border-strong);
  border-bottom: 1.5px solid var(--border-strong);
}

.article-entry .profile-dl-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px 16px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.95rem;
  line-height: 1.55;
}

.article-entry .profile-dl-row:last-child {
  border-bottom: none;
}

.article-entry .profile-dl-term {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  padding-top: 2px;
}

.article-entry .profile-dl-val {
  color: var(--ink-body);
}

@media (max-width: 520px) {
  .article-entry .profile-dl-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.article-entry .coursework-line {
  font-size: 0.94rem;
  color: var(--ink-secondary);
  line-height: 1.7;
  margin-top: 0.6em;
  text-align: left;
  -webkit-hyphens: none;
  hyphens: none;
}

.article-entry .coursework-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-right: 8px;
}

.article-entry ul.leader-list {
  list-style: none;
  padding-left: 0;
  margin: 1em 0 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.article-entry ul.leader-list > li.leader-row {
  margin-bottom: 0;
}

/* ==========================================================================
 * Math Formulas (KaTeX / MathJax overflow protection, 1em Mashiro scale)
 * ========================================================================== */
.article-entry eqn {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  margin: 1.2em 0;
}

.article-entry .katex-display,
.article-entry eq,
.article-entry section.eqno {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
  max-width: 100%;
}

.article-entry .katex-display {
  margin: 0.4em 0;
}

.article-entry .katex,
.article-entry .mjx-chtml,
.article-entry .MathJax {
  font-size: 1.02em !important;
}

@media (max-width: 480px) {
  .article-entry .katex-display .katex {
    font-size: 0.9em !important;
  }
}

/* Footnotes */
.footnotes-sep {
  margin-top: 2.5em;
  border: 0;
  border-top: 1px solid var(--border);
}

.footnotes {
  font-size: 0.9rem;
  color: var(--ink-secondary);
  line-height: 1.6;
}

/* ==========================================================================
 * Images, Captions, Video Aspect Ratio & Lightbox (Mashiro)
 * ========================================================================== */
.article-entry img {
  margin: 1.2em auto 0.4em;
  border-radius: 3px;
}

.article-entry img.is-zoomable {
  cursor: zoom-in;
}

.article-entry .caption,
.article-entry figcaption {
  display: block;
  text-align: center;
  font-size: 0.86rem;
  color: var(--ink-muted);
  margin: 0.4em 0 1.4em;
}

.aspect-ratio {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  margin: 1.5em 0;
}

.aspect-ratio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 14, 18, 0.88);
  padding: 24px;
}

.lightbox-overlay.is-open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
}

.lightbox-figure {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 3px;
}

.lightbox-caption {
  color: #e2e6ec;
  font-size: 0.92rem;
  text-align: center;
}

/* ==========================================================================
 * Article Footer & Prev/Next Post Navigation (Mashiro)
 * ========================================================================== */
.article-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.article-footer a {
  display: inline-block;
  position: relative;
  color: var(--ink-secondary);
  padding-bottom: 2px;
}

.article-footer a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: var(--ink);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.article-footer a:hover,
.article-footer a:focus-visible {
  color: var(--ink);
}

.article-footer a:hover::after,
.article-footer a:focus-visible::after {
  transform: scaleX(1);
}

#article-nav {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  position: relative;
}

@media (max-width: 600px) {
  #article-nav {
    grid-template-columns: 1fr;
  }
}

.article-nav-link {
  display: block;
  color: var(--ink-secondary);
}

.article-nav-title {
  display: inline;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-body);
  line-height: 1.45;
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 50% 100%;
  background-repeat: no-repeat;
  background-size: 0% 1.25px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: color 0.2s ease, background-size 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.article-nav-link:hover .article-nav-title,
.article-nav-link:focus-visible .article-nav-title {
  color: var(--ink);
  text-decoration: none;
  background-size: 100% 1.25px;
}

.article-nav-link.is-older {
  text-align: right;
}

@media (max-width: 600px) {
  .article-nav-link.is-older {
    text-align: left;
  }
}

.article-nav-caption {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

/* ==========================================================================
 * CJK Punctuation Compression (Mashiro biaodian.styl)
 * ========================================================================== */
.bd-box .bd-beg > .bd-inner {
  margin-right: -0.45em;
}

.bd-box .bd-end > .bd-inner {
  margin-left: -0.45em;
}
