.reveal {
  font-family: "Source Sans Pro", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --math-block-margin: -0.9em;
  --math-display-margin: -0.15em;
}

.reveal h1,
.reveal h2 {
  letter-spacing: 0;
  font-size: 1em;
}

.reveal .slides section#title-slide {
  height: 100%;
}

.reveal .slides section#title-slide .title {
  color: #111;
  letter-spacing: 0;
}

.course-title-branding {
  width: min(72%, 850px);
  margin: 2.2rem auto 0;
  padding-top: 1.1rem;
  border-top: 2px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  color: #111;
}

.course-title-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.course-title-signature {
  font-size: 0.42em;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.course-title-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
  font-size: 0.3em;
  color: #333;
}

.course-title-meta-item {
  padding: 0.12rem 0.42rem;
  border: 1px solid #111;
  border-radius: 999px;
  background: #fff;
}

.course-title-qr {
  width: 4.8rem;
  height: 4.8rem;
  object-fit: contain;
  border: 1px solid #111;
  padding: 0.2rem;
  background: #fff;
}

.reveal .slides section.slide {
  top: 0 !important;
  height: 100%;
  display: flex !important;
  flex-direction: column;
  justify-content: flex-start;
}

.reveal .slides section.slide > h2:first-child {
  flex: 0 0 auto;
  margin-top: 0.05em;
  margin-bottom: 0.2em;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  display: block;
  padding-left: 4.95em;
  line-height: 1.08;
  text-align: left;
  user-select: text;
  -webkit-user-select: text;
}

.slide-title-logo {
  position: absolute;
  left: 0;
  top: 25%;
  width: 3.45em;
  height: 1.3em;
  transform: translateY(-50%);
  object-fit: contain;
  object-position: left center;
  user-select: none;
  -webkit-user-select: none;
}

.slide-title-text {
  display: block;
  width: 100%;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
  writing-mode: horizontal-tb;
  user-select: text;
  -webkit-user-select: text;
}

.reveal .slides section.slide > .slide-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
  box-sizing: border-box;
  padding-top: 0.05em;
  padding-bottom: 0.18em;
}

.reveal section.slide > .slide-body > p,
.reveal section.slide > .slide-body > ul,
.reveal section.slide > .slide-body > ol,
.reveal section.slide > .slide-body > blockquote,
.reveal section.slide > .slide-body > .incremental {
  font-size: 0.68em;
  line-height: 1.12;
}

.reveal section.slide > .slide-body > .columns p,
.reveal section.slide > .slide-body > .columns li {
  font-size: 0.68em;
  line-height: 1.12;
}

.reveal section.slide > .slide-body li {
  margin-top: 0.12em;
  margin-bottom: 0.12em;
}

.reveal pre code {
  max-height: 600px;
  font-size: 0.72em;
  line-height: 1.35;
}

.code-viz-sync {
  align-items: stretch !important;
  gap: 0.75rem !important;
}

.code-viz-sync pre {
  margin-top: 0;
  margin-bottom: 0;
}

.code-viz-sync .viz-demo {
  margin-top: 0;
}

.code-viz-sync.fragment {
  opacity: 1 !important;
  visibility: visible !important;
}

.code-sync-line {
  display: block;                 /* 每行作为块级才能独立控制缩进 */
  padding: 0 0.35rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  /* 悬挂缩进：假设原代码常见缩进为 2em（可调整） */
  text-indent: -2em;              /* 首行向左拉回 */
  padding-left: calc(2em + 0.35rem);  /* 整体向右推，换行后自然形成缩进 */
}
.code-sync-line-active {
  background: #e7f0ff;
  box-shadow: inset 3px 0 0 #1266d6;  /* 用内阴影代替 border-left */
}

.reveal table {
  font-size: 0.72em;
  border-collapse: separate;
  border-spacing: 0.55rem 0.5rem;
  line-height: 1.22;
  margin-top: 0.25em !important;
  margin-bottom: 0.25em !important;
}

.reveal th,
.reveal td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #ddd;
}

.reveal section.slide p:has(> .math.display) {
  margin-top: var(--math-block-margin);
  margin-bottom: var(--math-block-margin);
  font-size: 0.64em !important;
  line-height: 1.02 !important;
}

.reveal .math.display {
  margin-top: var(--math-display-margin);
  margin-bottom: var(--math-display-margin);
  font-size: 0.96em !important;
  line-height: 1.02 !important;
}

.reveal .MathJax_Display,
.reveal mjx-container[display="true"] {
  font-size: 96% !important;
  margin-top: var(--math-display-margin) !important;
  margin-bottom: var(--math-display-margin) !important;
}

.reveal section.slide > .slide-body > p .math.inline {
  font-size: 0.94em;
}

.reveal .hash-demo {
  margin-top: 0.8rem;
}

.hash-demo-shell {
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.hash-demo-toolbar {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #e6e6e6;
  font-size: 0.55em;
}

.hash-demo-toolbar button {
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  background: #f7f7f7;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
}

.hash-demo-toolbar .status {
  margin-left: auto;
  color: #555;
}

.hash-table,
.hash-map {
  display: grid;
  gap: 0.22rem;
  padding: 0.45rem 0.6rem 0.55rem;
  font-size: 0.48em;
}

.hash-row {
  display: grid;
  grid-template-columns: 2.2rem 2.8rem 1fr;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-height: 1.52rem;
}

.hash-demo-compact .hash-table {
  gap: 0.12rem;
  padding: 0.3rem 0.55rem 0.35rem;
  font-size: 0.42em;
}

.hash-demo-compact .hash-row {
  min-height: 1.05rem;
}

.hash-demo-compact .hash-cell {
  min-height: 0.95rem;
  padding: 0.08rem 0.28rem;
}

.hash-demo-compact .hash-calc {
  min-height: 1.35rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.40em;
}

.hash-demo-compact .hash-note {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.43em;
}

.probe-order {
  height: 100%;
  display: grid;
  place-items: center;
  border-right: 1px solid #e6e6e6;
  color: #1266d6;
  font-weight: 900;
}

.probe-badge {
  display: inline-block;
  min-width: 1.5rem;
  text-align: right;
}

.hash-index {
  height: 100%;
  display: grid;
  place-items: center;
  background: #f1f3f5;
  font-weight: 700;
}

.hash-cell {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.4rem;
  min-height: 1.3rem;
}

.hash-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.12rem 0.38rem;
  border: 1px solid #555;
  border-radius: 4px;
  background: #fff;
  font-weight: 700;
}

.hash-calc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.6rem 0.35rem;
  border-top: 1px solid #eee;
  font-size: 0.47em;
}

.hash-calc-token {
  border-color: #111;
  font-weight: 700;
}

.hash-occupied {
  background: #f4f4f4;
  color: #555;
}

.hash-target {
  border-color: #1266d6;
  color: #1266d6;
}

.hash-empty {
  color: #888;
  border-style: dashed;
  border-color: #aaa;
}

.hash-deleted {
  border-style: dashed;
  border-color: #111;
  color: #111;
  background: #f6f6f6;
}

.hash-active {
  outline: 2px solid #2f6fdd;
}

.hash-home .hash-index {
  background: #e6f0ff;
}

.hash-current .hash-cell {
  box-shadow: inset 0 0 0 2px #1266d6;
}

.hash-success .hash-cell {
  box-shadow: inset 0 0 0 3px #18803b;
}

.hash-failure .hash-cell {
  box-shadow: inset 0 0 0 3px #a33;
}

.hash-note {
  padding: 0.4rem 0.6rem;
  border-top: 1px solid #e6e6e6;
  font-size: 0.50em;
  color: #333;
}

.chain-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.layout-3col,
.search-start-shell {
  --search-stack-width: 12rem;
  --search-arrow-col: 1.85rem;
  --search-label-col: 3.65rem;
  --search-value-col: 5.4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  align-items: start;
}

.layout-2col,
.prime-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.panel-minimal,
.search-panel {
  background: #fff;
  padding: 0.05rem 0.05rem 0.12rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.panel-title,
.search-panel-head {
  margin-bottom: 0.12rem;
  font-size: 0.42em;
  align-self: stretch;
  text-align: center;
}

.search-panel-head strong {
  font-size: 1.12em;
}

.stack-narrow,
.search-array,
.search-buckets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.08rem;
  margin-bottom: 0.12rem;
  max-width: 100%;
}

.search-start-shell {
  margin-top: 0.1rem;
}

.search-array {
  width: var(--search-stack-width);
}

.search-cell {
  min-height: 0;
}

.search-order {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 1.18rem;
  border-right: 1px solid #ddd;
  color: #1266d6;
  font-weight: 900;
}

.search-visited {
  outline: 2px solid #1266d6;
}

.search-hit .search-value,
.search-hit .hash-cell {
  background: #e8f1ff;
  color: #1266d6;
  font-weight: 900;
}

.search-mini-formula {
  font-size: 0.38em;
  font-weight: 900;
  text-align: center;
}

.search-hash-rule {
  padding: 0 0.1rem 0.08rem;
  margin-bottom: 0.1rem;
  font-size: 0.28em;
  font-weight: 800;
  text-align: center;
  line-height: 1.25;
}

.search-buckets {
  width: var(--search-stack-width);
}

.prime-panel {
  --search-arrow-col: 1.4rem;
  --search-label-col: 3.8rem;
  --search-value-col: 7.8rem;
}

.prime-title {
  font-weight: 900;
}

.prime-formula,
.prime-note {
  font-size: 0.38em;
  font-weight: 850;
  text-align: center;
  margin-bottom: 0.12rem;
}

.prime-note {
  color: #1266d6;
  margin-top: 0.12rem;
}

.prime-buckets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.07rem;
  width: 14rem;
  max-width: 100%;
}

.bucket-row,
.search-bucket-row {
  display: grid;
  grid-template-columns: var(--search-arrow-col) var(--search-label-col) var(--search-value-col);
  align-items: stretch;
  border: 1px solid #111;
  min-width: 0;
  min-height: 1rem;
  font-size: 0.35em;
}

.search-bucket-row .search-order {
  min-height: 1rem;
  border-right: 1px solid #ddd;
  border-bottom: none;
}

.search-bucket-row .hash-index {
  font-size: 0.9em;
}

.search-bucket-row .hash-cell {
  justify-content: center;
  padding: 0.04rem;
  min-height: 0;
}

.mind-map {
  min-height: 430px;
  position: relative;
  display: grid;
  grid-template-columns: 0.7fr 1.8fr;
  align-items: center;
  gap: 1rem;
}

.mind-node {
  display: block;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  text-decoration: none;
  padding: 0.48rem 0.58rem;
  font-size: 0.46em;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
}

.mind-node span {
  color: #555;
  font-size: 0.78em;
  font-weight: 700;
}

.mind-center {
  border-width: 3px;
  font-size: 0.62em;
  padding: 0.8rem 0.7rem;
}

.mind-ring {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.mind-node:hover {
  border-color: #1266d6;
  color: #1266d6;
}

.concept-diagram {
  display: grid;
  gap: 0.6rem;
  padding: 0.6rem;
  min-height: 380px;
  align-content: center;
}

.diagram-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.diagram-box,
.diagram-circle {
  border: 2px solid #111;
  background: #fff;
  color: #111;
  padding: 0.55rem 0.8rem;
  min-width: 5.4rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.58em;
}

.balls-diagram {
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 250px;
}

.diagram-circle {
  border-radius: 999px;
  min-width: 3rem;
  min-height: 3rem;
  display: inline-grid;
  place-items: center;
}

.diagram-arrow {
  color: #111;
  font-size: 1.2em;
  font-weight: 700;
}

.accent {
  color: #1266d6;
  font-weight: 800;
}

.balls-area {
  position: relative;
  height: 170px;
  border: 2px solid #111;
  background: #fff;
  overflow: hidden;
  background-image: linear-gradient(to right, transparent calc(100% / 20 - 1px), #ddd calc(100% / 20));
  background-size: calc(100% / 20) 100%;
}

.ball {
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid #111;
  border-radius: 50%;
  background: #fff;
  transition: top 0.45s ease;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  align-items: end;
  gap: 0.3rem;
  height: 145px;
  padding: 0.5rem;
  border: 2px solid #111;
}

.bar {
  border: 2px solid #111;
  background: #fff;
  position: relative;
  min-width: 0;
}

.bar span {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.42em;
}

.code-note {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.64em;
  line-height: 1.45;
}

.code-step-notes {
  position: relative;
  min-height: 4.2rem;
  margin-top: 0.45rem;
  border-top: 1px solid #ddd;
  padding-top: 0.35rem;
}

.code-step-notes .fragment {
  position: absolute;
  inset: 0;
}

.code-walk-fragments {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.code-walk-marker {
  display: inline-block;
}

.code-walk-note {
  display: none;
}

.code-walk-note-active {
  display: block;
}

.code-walk-active-line {
  background: #e8f1ff;
  box-shadow: inset 3px 0 0 #1266d6;
}

.rehash-compare {
  display: grid;
  grid-template-columns: 1fr 0.35fr 1.2fr;
  gap: 0.35rem;
  align-items: center;
  padding: 0.35rem;
}

.rehash-block {
  border: 2px solid #111;
  background: #fff;
}

.rehash-array {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.12rem;
  padding: 0.3rem;
  font-size: 0.36em;
}

.rehash-block:nth-child(3) .rehash-array {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.rehash-slot {
  border: 1px solid #111;
  min-width: 0;
}

.rehash-index {
  background: #f1f3f5;
  border-bottom: 1px solid #111;
  text-align: center;
  font-weight: 800;
  padding: 0.04rem;
}

.rehash-cell {
  min-height: 1rem;
  display: grid;
  place-items: center;
  padding: 0.08rem;
}

.rehash-cell .hash-token {
  min-width: 1.2rem;
  padding: 0.04rem 0.16rem;
}

.rehash-title,
.rehash-formula {
  padding: 0.25rem 0.35rem;
  font-size: 0.42em;
  font-weight: 800;
  text-align: center;
}

.rehash-title {
  border-bottom: 2px solid #111;
}

.rehash-formula {
  border-top: 1px solid #ddd;
  color: #1266d6;
}

.rehash-arrow {
  border: 2px solid #111;
  padding: 0.35rem;
  text-align: center;
  font-size: 0.46em;
  font-weight: 800;
}

.reveal img[src*="search-"] {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.industry-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.55rem auto 0;
  max-width: 900px;
}

.industry-strip.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.32rem;
}

.industry-card {
  border: 1.5px solid #111;
  background: #fff;
  padding: 0.35rem 0.42rem;
  min-height: 2.25rem;
  text-align: left;
  overflow: hidden;
}

.industry-card p {
  margin: 0;
}

.industry-card img {
  width: 1.55rem;
  height: 1.55rem;
  object-fit: contain;
  float: left;
  margin: 0.05rem 0.35rem 0.18rem 0;
}

.industry-card strong {
  display: block;
  color: #111;
  font-size: 0.42em;
  line-height: 1.1;
}

.industry-card span,
.industry-card p:last-child {
  display: block;
  color: #333;
  font-size: 0.3em;
  line-height: 1.2;
  margin-top: 0.12rem;
}

.reading-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.reading-step {
  border-top: 3px solid #1266d6;
  background: #f8fafc;
  padding: 0.35rem 0.4rem;
  min-height: 2.1rem;
}

.reading-step strong {
  display: block;
  font-size: 0.45em;
  line-height: 1.1;
}

.reading-step span,
.reading-step p:last-child {
  display: block;
  font-size: 0.32em;
  line-height: 1.25;
  margin-top: 0.16rem;
}