/* Fonts loaded via <link> in head (scripts/font-inject.js). */

/* ── Global font: PT Serif for Latin, Noto Serif SC for CJK ─────────── */
html, body, * {
  font-family: 'PT Serif', 'Noto Serif SC', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Base size and line-height (Lei Mao: 14px base, 1.5 lh) ─────────── */
html {
  font-size: 14px;
}

/* ── Navbar ──────────────────────────────────────────────────────────── */
.navbar,
.navbar-brand,
.navbar-item,
.navbar-item.navbar-logo,
a.navbar-item,
.navbar-link,
.navbar-menu,
.navbar-start,
.navbar-end {
  font-family: 'Exo 2', sans-serif !important;
  letter-spacing: 0.05em;
  font-weight: 800;
  font-size: 1.1rem !important;
}

/* ── Article & sidebar body text ─────────────────────────────────────── */
.content,
.content p,
.content li,
.content blockquote,
.content td,
.content th,
.widget,
.menu-list a,
.card-content,
.article-meta {
  font-family: 'PT Serif', 'Noto Serif SC', Georgia, serif !important;
  line-height: 1.5;
}

/* ── Article meta icons ──────────────────────────────────────────────── */
.article-meta .meta-icon {
  margin-right: 0.3em;
  color: #aaa;
}

/* ── Article body ─────────────────────────────────────────────────────── */
.article .content {
  font-size: 0.9em;
  font-weight: 500;
  color: #1a1a1a;
}

.article .content p {
  margin-bottom: 1em;
}

/* ── Headings ────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Exo 2', sans-serif !important;
  font-weight: 800;
  color: #111;
  letter-spacing: 0.02em;
}

/* ── Article title ───────────────────────────────────────────────────── */
.article .title {
  font-family: 'Exo 2', sans-serif !important;
  font-size: 2.9rem !important;
  font-weight: 700;
  color: #111 !important;
  line-height: 1.25;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem !important;
}

/* ── Meta info ───────────────────────────────────────────────────────── */
.article-meta {
  font-size: 0.78rem !important;
  color: #999 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 2rem !important;
}

/* ── Section headings inside article ─────────────────────────────────── */
.article .content h2 {
  font-size: 1.28rem;
  font-weight: 700 !important;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.article .content h3 {
  font-size: 1.07rem;
  font-weight: 600 !important;
  margin-top: 1.5rem;
  margin-bottom: 0.3rem;
}

/* ── Profile card compact ────────────────────────────────────────────── */
.widget[data-type="profile"] .card-content {
  padding: 1rem !important;
}

.widget[data-type="profile"] .image.is-128x128 {
  width: 80px !important;
  height: 80px !important;
}

.widget[data-type="profile"] .title.is-size-4 {
  font-size: 1rem !important;
  margin-bottom: 0.1rem !important;
}

.widget[data-type="profile"] .is-size-6 {
  font-size: 0.78rem !important;
}

.widget[data-type="profile"] .level.is-mobile {
  margin-top: 0.6rem !important;
  margin-bottom: 0.6rem !important;
}

.widget[data-type="profile"] .level .heading {
  font-size: 0.65rem !important;
}

.widget[data-type="profile"] .level .title {
  font-size: 1rem !important;
}

/* ── TOC hidden on non-post pages, categories hidden on post pages ───── */
.widget[data-type="toc"] { display: none; }

/* ── TOC scrollable and compact ─────────────────────────────────────── */
#toc .card-content {
  max-height: calc(80vh - 20px);
  overflow-y: auto;
}

#toc .menu-list li {
  line-height: 0.5;
}

#toc .menu-list a {
  padding: 0.1em 0.1em;
  font-size: 0.72rem;
}

/* ── Sidebar widths ──────────────────────────────────────────────────── */
@media screen and (min-width: 1280px) {
  .column-left {
    width: 20% !important;
    flex: none !important;
  }
  .column-right {
    width: 20% !important;
    flex: none !important;
  }
}

/* ── Tags, buttons, pagination ───────────────────────────────────────── */
.tag, .button, .tabs li a, .pagination, .breadcrumb,
.footer, .footer a {
  font-family: 'PT Serif', 'Noto Serif SC', Georgia, serif !important;
}

/* ── Code blocks ─────────────────────────────────────────────────────── */
code, pre, kbd,
.highlight,
.highlight span {
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  font-size: 0.875em;
}

.content p > code,
.content li > code {
  background: #f5f2f0;
  border-radius: 3px;
  padding: 0.1em 0.35em;
  color: #c0392b;
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
}

/* ── Xiaohongshu icon (Simple Icons SVG via CSS mask) ───────────────── */
.si-xiaohongshu {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg role='img' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22.405 9.879c.002.016.01.02.07.019h.725a.797.797 0 0 0 .78-.972.794.794 0 0 0-.884-.618.795.795 0 0 0-.692.794c0 .101-.002.666.001.777zm-11.509 4.808c-.203.001-1.353.004-1.685.003a2.528 2.528 0 0 1-.766-.126.025.025 0 0 0-.03.014L7.7 16.127a.025.025 0 0 0 .01.032c.111.06.336.124.495.124.66.01 1.32.002 1.981 0 .01 0 .02-.006.023-.015l.712-1.545a.025.025 0 0 0-.024-.036zM.477 9.91c-.071 0-.076.002-.076.01a.834.834 0 0 0-.01.08c-.027.397-.038.495-.234 3.06-.012.24-.034.389-.135.607-.026.057-.033.042.003.112.046.092.681 1.523.787 1.74.008.015.011.02.017.02.008 0 .033-.026.047-.044.147-.187.268-.391.371-.606.306-.635.44-1.325.486-1.706.014-.11.021-.22.03-.33l.204-2.616.022-.293c.003-.029 0-.033-.03-.034zm7.203 3.757a1.427 1.427 0 0 1-.135-.607c-.004-.084-.031-.39-.235-3.06a.443.443 0 0 0-.01-.082c-.004-.011-.052-.008-.076-.008h-1.48c-.03.001-.034.005-.03.034l.021.293c.076.982.153 1.964.233 2.946.05.4.186 1.085.487 1.706.103.215.223.419.37.606.015.018.037.051.048.049.02-.003.742-1.642.804-1.765.036-.07.03-.055.003-.112zm3.861-.913h-.872a.126.126 0 0 1-.116-.178l1.178-2.625a.025.025 0 0 0-.023-.035l-1.318-.003a.148.148 0 0 1-.135-.21l.876-1.954a.025.025 0 0 0-.023-.035h-1.56c-.01 0-.02.006-.024.015l-.926 2.068c-.085.169-.314.634-.399.938a.534.534 0 0 0-.02.191.46.46 0 0 0 .23.378.981.981 0 0 0 .46.119h.59c.041 0-.688 1.482-.834 1.972a.53.53 0 0 0-.023.172.465.465 0 0 0 .23.398c.15.092.342.12.475.12l1.66-.001c.01 0 .02-.006.023-.015l.575-1.28a.025.025 0 0 0-.024-.035zm-6.93-4.937H3.1a.032.032 0 0 0-.034.033c0 1.048-.01 2.795-.01 6.829 0 .288-.269.262-.28.262h-.74c-.04.001-.044.004-.04.047.001.037.465 1.064.555 1.263.01.02.03.033.051.033.157.003.767.009.938-.014.153-.02.3-.06.438-.132.3-.156.49-.419.595-.765.052-.172.075-.353.075-.533.002-2.33 0-4.66-.007-6.991a.032.032 0 0 0-.032-.032zm11.784 6.896c0-.014-.01-.021-.024-.022h-1.465c-.048-.001-.049-.002-.05-.049v-4.66c0-.072-.005-.07.07-.07h.863c.08 0 .075.004.075-.074V8.393c0-.082.006-.076-.08-.076h-3.5c-.064 0-.075-.006-.075.073v1.445c0 .083-.006.077.08.077h.854c.075 0 .07-.004.07.07v4.624c0 .095.008.084-.085.084-.37 0-1.11-.002-1.304 0-.048.001-.06.03-.06.03l-.697 1.519s-.014.025-.008.036c.006.01.013.008.058.008 1.748.003 3.495.002 5.243.002.03-.001.034-.006.035-.033v-1.539zm4.177-3.43c0 .013-.007.023-.02.024-.346.006-.692.004-1.037.004-.014-.002-.022-.01-.022-.024-.005-.434-.007-.869-.01-1.303 0-.072-.006-.071.07-.07l.733-.003c.041 0 .081.002.12.015.093.025.16.107.165.204.006.431.002 1.153.001 1.153zm2.67.244a1.953 1.953 0 0 0-.883-.222h-.18c-.04-.001-.04-.003-.042-.04V10.21c0-.132-.007-.263-.025-.394a1.823 1.823 0 0 0-.153-.53 1.533 1.533 0 0 0-.677-.71 2.167 2.167 0 0 0-1-.258c-.153-.003-.567 0-.72 0-.07 0-.068.004-.068-.065V7.76c0-.031-.01-.041-.046-.039H17.93s-.016 0-.023.007c-.006.006-.008.012-.008.023v.546c-.008.036-.057.015-.082.022h-.95c-.022.002-.028.008-.03.032v1.481c0 .09-.004.082.082.082h.913c.082 0 .072.128.072.128V11.19s.003.117-.06.117h-1.482c-.068 0-.06.082-.06.082v1.445s-.01.068.064.068h1.457c.082 0 .076-.006.076.079v3.225c0 .088-.007.081.082.081h1.43c.09 0 .082.007.082-.08v-3.27c0-.029.006-.035.033-.035l2.323-.003c.098 0 .191.02.28.061a.46.46 0 0 1 .274.407c.008.395.003.79.003 1.185 0 .259-.107.367-.33.367h-1.218c-.023.002-.029.008-.028.033.184.437.374.871.57 1.303a.045.045 0 0 0 .04.026c.17.005.34.002.51.003.15-.002.517.004.666-.01a2.03 2.03 0 0 0 .408-.075c.59-.18.975-.698.976-1.313v-1.981c0-.128-.01-.254-.034-.38 0 .078-.029-.641-.724-.998z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg role='img' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22.405 9.879c.002.016.01.02.07.019h.725a.797.797 0 0 0 .78-.972.794.794 0 0 0-.884-.618.795.795 0 0 0-.692.794c0 .101-.002.666.001.777zm-11.509 4.808c-.203.001-1.353.004-1.685.003a2.528 2.528 0 0 1-.766-.126.025.025 0 0 0-.03.014L7.7 16.127a.025.025 0 0 0 .01.032c.111.06.336.124.495.124.66.01 1.32.002 1.981 0 .01 0 .02-.006.023-.015l.712-1.545a.025.025 0 0 0-.024-.036zM.477 9.91c-.071 0-.076.002-.076.01a.834.834 0 0 0-.01.08c-.027.397-.038.495-.234 3.06-.012.24-.034.389-.135.607-.026.057-.033.042.003.112.046.092.681 1.523.787 1.74.008.015.011.02.017.02.008 0 .033-.026.047-.044.147-.187.268-.391.371-.606.306-.635.44-1.325.486-1.706.014-.11.021-.22.03-.33l.204-2.616.022-.293c.003-.029 0-.033-.03-.034zm7.203 3.757a1.427 1.427 0 0 1-.135-.607c-.004-.084-.031-.39-.235-3.06a.443.443 0 0 0-.01-.082c-.004-.011-.052-.008-.076-.008h-1.48c-.03.001-.034.005-.03.034l.021.293c.076.982.153 1.964.233 2.946.05.4.186 1.085.487 1.706.103.215.223.419.37.606.015.018.037.051.048.049.02-.003.742-1.642.804-1.765.036-.07.03-.055.003-.112zm3.861-.913h-.872a.126.126 0 0 1-.116-.178l1.178-2.625a.025.025 0 0 0-.023-.035l-1.318-.003a.148.148 0 0 1-.135-.21l.876-1.954a.025.025 0 0 0-.023-.035h-1.56c-.01 0-.02.006-.024.015l-.926 2.068c-.085.169-.314.634-.399.938a.534.534 0 0 0-.02.191.46.46 0 0 0 .23.378.981.981 0 0 0 .46.119h.59c.041 0-.688 1.482-.834 1.972a.53.53 0 0 0-.023.172.465.465 0 0 0 .23.398c.15.092.342.12.475.12l1.66-.001c.01 0 .02-.006.023-.015l.575-1.28a.025.025 0 0 0-.024-.035zm-6.93-4.937H3.1a.032.032 0 0 0-.034.033c0 1.048-.01 2.795-.01 6.829 0 .288-.269.262-.28.262h-.74c-.04.001-.044.004-.04.047.001.037.465 1.064.555 1.263.01.02.03.033.051.033.157.003.767.009.938-.014.153-.02.3-.06.438-.132.3-.156.49-.419.595-.765.052-.172.075-.353.075-.533.002-2.33 0-4.66-.007-6.991a.032.032 0 0 0-.032-.032zm11.784 6.896c0-.014-.01-.021-.024-.022h-1.465c-.048-.001-.049-.002-.05-.049v-4.66c0-.072-.005-.07.07-.07h.863c.08 0 .075.004.075-.074V8.393c0-.082.006-.076-.08-.076h-3.5c-.064 0-.075-.006-.075.073v1.445c0 .083-.006.077.08.077h.854c.075 0 .07-.004.07.07v4.624c0 .095.008.084-.085.084-.37 0-1.11-.002-1.304 0-.048.001-.06.03-.06.03l-.697 1.519s-.014.025-.008.036c.006.01.013.008.058.008 1.748.003 3.495.002 5.243.002.03-.001.034-.006.035-.033v-1.539zm4.177-3.43c0 .013-.007.023-.02.024-.346.006-.692.004-1.037.004-.014-.002-.022-.01-.022-.024-.005-.434-.007-.869-.01-1.303 0-.072-.006-.071.07-.07l.733-.003c.041 0 .081.002.12.015.093.025.16.107.165.204.006.431.002 1.153.001 1.153zm2.67.244a1.953 1.953 0 0 0-.883-.222h-.18c-.04-.001-.04-.003-.042-.04V10.21c0-.132-.007-.263-.025-.394a1.823 1.823 0 0 0-.153-.53 1.533 1.533 0 0 0-.677-.71 2.167 2.167 0 0 0-1-.258c-.153-.003-.567 0-.72 0-.07 0-.068.004-.068-.065V7.76c0-.031-.01-.041-.046-.039H17.93s-.016 0-.023.007c-.006.006-.008.012-.008.023v.546c-.008.036-.057.015-.082.022h-.95c-.022.002-.028.008-.03.032v1.481c0 .09-.004.082.082.082h.913c.082 0 .072.128.072.128V11.19s.003.117-.06.117h-1.482c-.068 0-.06.082-.06.082v1.445s-.01.068.064.068h1.457c.082 0 .076-.006.076.079v3.225c0 .088-.007.081.082.081h1.43c.09 0 .082.007.082-.08v-3.27c0-.029.006-.035.033-.035l2.323-.003c.098 0 .191.02.28.061a.46.46 0 0 1 .274.407c.008.395.003.79.003 1.185 0 .259-.107.367-.33.367h-1.218c-.023.002-.029.008-.028.033.184.437.374.871.57 1.303a.045.045 0 0 0 .04.026c.17.005.34.002.51.003.15-.002.517.004.666-.01a2.03 2.03 0 0 0 .408-.075c.59-.18.975-.698.976-1.313v-1.981c0-.128-.01-.254-.034-.38 0 .078-.029-.641-.724-.998z'/%3E%3C/svg%3E") no-repeat center / contain;
  vertical-align: -0.125em;
}

/* ── Disable image click-through in articles ─────────────────────────── */
.article .content a:has(> img) {
  pointer-events: none;
  cursor: default;
}

/* ── KaTeX ───────────────────────────────────────────────────────────── */
.katex { font-size: 1.1em; }

/* ── Post citation block ─────────────────────────────────────────────── */
.post-citation {
  margin-top: 2.5rem;
  padding: 1rem 1.2rem;
  background: #f8f8f8;
  font-family: 'PT Serif', 'Noto Serif SC', Georgia, serif;
}

.post-citation .citation-title {
  font-size: 1rem;
  font-weight: 700;
  color: #555;
  margin-bottom: 0.2rem !important;
}

.post-citation .citation-url {
  font-size: 0.82rem;
  margin-bottom: 0.75rem !important;
  word-break: break-all;
}

.post-citation .citation-url a {
  color: #3273dc;
  text-decoration: none;
}

.post-citation .citation-meta {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.post-citation .citation-col {
  display: flex;
  flex-direction: column;
}

.post-citation .citation-label {
  font-size: 0.68rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.1rem;
}

.post-citation .citation-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: #666;
}

/* ═══════════════════════════════════════════════════════════════════════
   Waline comment widget — override CSS variables to match page style
   ═══════════════════════════════════════════════════════════════════════ */

/* Waline CSS custom properties */
#comments .v,
.v[data-class="v"] {
  --waline-font-size: 0.95rem;
  --waline-font-family: 'Noto Serif SC', 'Source Han Serif SC', Georgia, serif;
  --waline-color: #363636;
  --waline-bgcolor: #ffffff;
  --waline-bgcolor-light: #f8f8f8;
  --waline-bgcolor-hover: #f5f5f5;
  --waline-border-color: #dbdbdb;
  --waline-disable-bgcolor: #f5f5f5;
  --waline-disable-color: #b5b5b5;
  --waline-theme-color: #3273dc;
  --waline-active-color: #3273dc;
  --waline-avatar-radius: 50%;
  --waline-avatar-size: 2.5rem;
  --waline-badge-color: #3273dc;
  --waline-info-bgcolor: #f5f5f5;
  --waline-info-color: #7a7a7a;
  --waline-bq-color: #f0f0f0;
  --waline-border: 1px solid var(--waline-border-color);
}

/* Font override for all Waline text elements */
.v,
.v *,
.v input,
.v textarea,
.v button,
.v .vlist .vcard .vhead,
.v .vlist .vcard .vcontent,
.v .vlist .vcard .vfooter,
.v .veditor,
.v .vpanel,
.v .vcount,
.v .vnav {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', Georgia, serif !important;
}

/* Comment section card header */
#comments .card-content h3.title {
  font-size: 1.1rem;
  font-weight: 500;
  color: #363636;
  border-bottom: 1px solid #dbdbdb;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

/* Input and textarea: match page style */
.v .veditor,
.v input,
.v textarea {
  border-radius: 4px !important;
  border-color: #dbdbdb !important;
  font-size: 0.95rem !important;
  padding: 0.6em 0.8em !important;
  line-height: 1.7 !important;
}

.v .veditor:focus,
.v input:focus,
.v textarea:focus {
  border-color: #3273dc !important;
  box-shadow: 0 0 0 0.125em rgba(50, 115, 220, 0.25) !important;
  outline: none !important;
}

/* Submit button */
.v .vbtn {
  background-color: #3273dc !important;
  border-color: #3273dc !important;
  color: #fff !important;
  border-radius: 4px !important;
  font-size: 0.9rem !important;
  padding: 0.4em 1em !important;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.v .vbtn:hover {
  background-color: #2366d1 !important;
}

/* Comment list item */
.v .vlist .vcard {
  border-bottom: 1px solid #f0f0f0;
  padding: 1rem 0;
}

.v .vlist .vcard:last-child {
  border-bottom: none;
}

/* Avatar */
.v .vlist .vcard .vhead .vavatar img {
  border-radius: 50%;
  border: 2px solid #f0f0f0;
}

/* Comment content */
.v .vlist .vcard .vcontent {
  line-height: 1.8;
  color: #4a4a4a;
  font-size: 0.95rem;
}

/* Reply and like buttons */
.v .vlist .vcard .vfooter .vaction {
  font-size: 0.82rem;
  color: #7a7a7a;
}

/* Comment count */
.v .vcount {
  font-size: 0.9rem;
  color: #7a7a7a;
}
