/* Luogu Markdown extensions. Loaded after footer.ejs's legacy rendered styles. */
.luogu-align-center { text-align: center; }
.luogu-align-right { text-align: right; }
.luogu-align > :first-child { margin-top: 0; }
.luogu-align > :last-child { margin-bottom: 0; }
.luogu-align-center p, .luogu-align-center h1, .luogu-align-center h2,
.luogu-align-center h3, .luogu-align-center h4, .luogu-align-center h5, .luogu-align-center h6 { text-align: center !important; }
.luogu-align-right p, .luogu-align-right h1, .luogu-align-right h2,
.luogu-align-right h3, .luogu-align-right h4, .luogu-align-right h5, .luogu-align-right h6 { text-align: right !important; }
.luogu-align img { display: inline-block !important; float: none !important; margin: 0 !important; vertical-align: middle; }
.luogu-align-center .luogu-video { margin-left: auto; margin-right: auto; }
.luogu-align-right .luogu-video { margin-left: auto; margin-right: 0; }

.luogu-epigraph {
  display: flex;
  flex-direction: column;
  max-width: 45rem;
  margin: 1.5em auto;
  padding: .5em 1.25em;
  border-left: 3px solid var(--border-color);
  color: var(--text-secondary);
}
.luogu-epigraph blockquote { order: 1; margin: 0; padding: 0; border: 0; font-style: italic; }
.luogu-epigraph figcaption { order: 2; margin-top: .55em; text-align: right; font-style: normal; }

details.rendered.luogu-alert {
  padding: .65em 1em !important;
  border-radius: 0 .35em .35em 0;
  background: var(--bg-nested);
}
details.rendered.luogu-alert > summary.rendered { cursor: pointer; }
details.rendered.luogu-alert > summary.rendered::before,
details.rendered.luogu-alert > summary.rendered::after { background-color: currentColor !important; }
details.rendered.luogu-alert > :not(summary) { margin-left: 1.5em; }

table.rendered.cute-table.cute-table-tuack {
  display: table !important;
  width: max-content;
  max-width: 100%;
  margin: .8em auto !important;
  border-collapse: collapse !important;
  border-top: 3px solid var(--border-color) !important;
  border-bottom: 3px solid var(--border-color) !important;
  color: inherit;
}
table.rendered.cute-table.cute-table-tuack thead { border-bottom: 2px solid var(--border-color) !important; }
table.rendered.cute-table.cute-table-tuack td,
table.rendered.cute-table.cute-table-tuack th {
  border: 1px solid var(--border-light) !important;
  padding: .45em .75em !important;
  text-align: center;
  vertical-align: middle;
}

table.rendered.cute-table.cute-table-tuack th { background: var(--bg-nested); font-weight: 600; }
.luogu-align-right table.rendered.cute-table.cute-table-tuack { margin-right: 0 !important; }
.luogu-align-center table.rendered.cute-table.cute-table-tuack { margin-left: auto !important; margin-right: auto !important; }

.luogu-task-item { list-style: none; }
.luogu-task-checkbox { margin: 0 .55em 0 -1.25em; vertical-align: middle; }

/* The outer segment matches the site's existing code block and copy button. */
.ui.existing.segment.luogu-code-segment { display: flow-root; border: 1px solid var(--border-color) !important; }
.ui.existing.segment.luogu-code-segment > pre.luogu-code {
  overflow-x: auto;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.45 !important;
}
.ui.existing.segment.luogu-code-segment > pre.luogu-code > code {
  display: block;
  min-width: max-content;
  white-space: normal;
  line-height: inherit !important;
}
.ui.existing.segment.luogu-code-segment .luogu-code-line {
  display: block;
  white-space: pre;
  line-height: 1.45em !important;
  min-height: 1.45em;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.luogu-code-numbered .luogu-code-line { position: relative; padding-left: 3.7em; }
.luogu-code-numbered .luogu-code-line::before {
  content: attr(data-line);
  position: absolute;
  left: 0;
  width: 2.8em;
  padding-right: .6em;
  text-align: right;
  color: var(--text-secondary);
  border-right: 1px solid var(--border-color);
  user-select: none;
}
.luogu-code-line.luogu-code-emphasis { background: var(--bg-active); }

.luogu-video { display: block; position: relative; width: min(100%, 800px); aspect-ratio: 16 / 9; margin: 1em auto; }
.luogu-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

