.iof-guide-post {
  --iof-blue: #64d5f4;
  --iof-purple: #aa9cff;
  --iof-green: #70d9b2;
  --iof-gold: #efbd72;
  --iof-red: #ff939d;
  --iof-panel: rgba(16, 20, 33, 0.92);
  --iof-panel-soft: rgba(24, 29, 46, 0.78);
  --iof-line: rgba(170, 156, 255, 0.35);
  --iof-shadow: 0 20px 55px rgba(0, 0, 0, 0.2);
}

:root[data-theme="light"] .iof-guide-post {
  --iof-blue: #087ea4;
  --iof-purple: #6652d8;
  --iof-green: #187d59;
  --iof-gold: #8a6200;
  --iof-red: #b63847;
  --iof-panel: #ffffff;
  --iof-panel-soft: #f1f3f8;
  --iof-line: rgba(102, 82, 216, 0.28);
  --iof-shadow: 0 20px 55px rgba(31, 42, 68, 0.1);
}

.iof-guide-post .iof-wide {
  margin-left: 50%;
  max-width: 960px;
  transform: translateX(-50%);
  width: min(960px, calc(100vw - 3rem));
}

.iof-guide-post .iof-note {
  align-items: start;
  background: var(--iof-panel-soft);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: grid;
  gap: 1rem;
  grid-template-columns: 34px 1fr;
  margin: 2rem 0;
  padding: 1.2rem 1.3rem;
}

.iof-guide-post .iof-note svg {
  color: var(--iof-gold);
  height: 30px;
  margin-top: 0.1rem;
  width: 30px;
}

.iof-guide-post .iof-note p {
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0;
}

.iof-guide-post .iof-note strong { color: var(--text-color); }

.iof-guide-post .iof-figure {
  background: var(--iof-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--iof-shadow);
  margin-bottom: 2.75rem;
  margin-top: 2.25rem;
  padding: clamp(1rem, 3vw, 1.8rem);
  text-align: left;
}

.iof-guide-post .iof-figure figcaption {
  border-top: 1px solid var(--border-color);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-top: 1.4rem;
  padding-top: 1rem;
  text-align: center;
}

.iof-guide-post .iof-subject {
  align-items: center;
  background: color-mix(in srgb, var(--iof-purple) 12%, var(--iof-panel-soft));
  border: 1px solid var(--iof-line);
  border-radius: 10px;
  display: flex;
  gap: 1rem;
  margin: 0 0 1.6rem;
  padding: 1rem 1.2rem;
  width: 100%;
}

.iof-guide-post .iof-icon {
  color: var(--iof-purple);
  flex: 0 0 auto;
  height: 34px;
  stroke-width: 1.8;
  width: 34px;
}

.iof-guide-post .iof-subject strong,
.iof-guide-post .iof-card strong,
.iof-guide-post .iof-canon-card strong,
.iof-guide-post .iof-state strong {
  color: var(--text-color);
  display: block;
  font-size: 0.98rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.iof-guide-post .iof-subject span,
.iof-guide-post .iof-card span,
.iof-guide-post .iof-canon-card p,
.iof-guide-post .iof-state p {
  color: var(--text-secondary);
  display: block;
  font-size: 0.87rem;
  line-height: 1.55;
  margin: 0;
}

.iof-guide-post .iof-layer-flow {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.iof-guide-post .iof-card {
  background: var(--iof-panel-soft);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  min-height: 172px;
  padding: 1.1rem;
  position: relative;
}

.iof-guide-post .iof-card .iof-icon {
  color: var(--iof-blue);
  margin-bottom: 0.8rem;
}

.iof-guide-post .iof-card:nth-child(3) .iof-icon { color: var(--iof-purple); }
.iof-guide-post .iof-card:nth-child(4) .iof-icon { color: var(--iof-green); }
.iof-guide-post .iof-card:nth-child(1) .iof-icon { color: var(--iof-gold); }

.iof-guide-post .iof-lineage-wrap {
  background:
    linear-gradient(rgba(170, 156, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(170, 156, 255, 0.07) 1px, transparent 1px),
    var(--iof-panel-soft);
  background-size: 36px 36px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  padding: 0.5rem;
}

.iof-guide-post .iof-lineage-svg {
  display: block;
  height: auto;
  width: 100%;
}

.iof-guide-post .iof-lineage-svg .edge {
  fill: none;
  stroke: var(--iof-purple);
  stroke-linecap: round;
  stroke-width: 3;
}

.iof-guide-post .iof-lineage-svg .edge--fan { stroke: var(--iof-blue); }
.iof-guide-post .iof-lineage-svg .edge--merge { stroke: var(--iof-green); }

.iof-guide-post .iof-lineage-svg .node rect {
  fill: var(--iof-panel);
  stroke: var(--iof-line);
  stroke-width: 2;
}

.iof-guide-post .iof-lineage-svg .node--fan rect { stroke: var(--iof-blue); }
.iof-guide-post .iof-lineage-svg .node--merge rect { stroke: var(--iof-green); }

.iof-guide-post .iof-lineage-svg text {
  fill: var(--text-color);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 650;
}

.iof-guide-post .iof-lineage-svg .secondary {
  fill: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.iof-guide-post .iof-canon,
.iof-guide-post .iof-lifecycle {
  display: grid;
  gap: 1rem;
}

.iof-guide-post .iof-canon { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.iof-guide-post .iof-lifecycle { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.iof-guide-post .iof-canon-card,
.iof-guide-post .iof-state {
  background: var(--iof-panel-soft);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.2rem;
}

.iof-guide-post .iof-state {
  display: flex;
  flex-direction: column;
}

.iof-guide-post .iof-state > p {
  flex: 1;
  padding-bottom: 1.25rem;
}

.iof-guide-post .iof-canon-card .iof-icon,
.iof-guide-post .iof-state .iof-icon { margin-bottom: 0.75rem; }

.iof-guide-post .iof-canon-card:nth-child(1) .iof-icon { color: var(--iof-purple); }
.iof-guide-post .iof-canon-card:nth-child(2) .iof-icon { color: var(--iof-blue); }
.iof-guide-post .iof-canon-card:nth-child(3) .iof-icon { color: var(--iof-gold); }
.iof-guide-post .iof-state--active .iof-icon { color: var(--iof-green); }
.iof-guide-post .iof-state--dormant .iof-icon { color: var(--iof-gold); }
.iof-guide-post .iof-state--death .iof-icon { color: var(--iof-red); }

.iof-guide-post .iof-lifecycle-arrow {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-color);
}

@media (max-width: 780px) {
  .iof-guide-post .iof-layer-flow {
    gap: 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 620px) {
  .iof-guide-post .iof-wide { width: calc(100vw - 2rem); }

  .iof-guide-post .iof-figure { border-radius: 10px; }

  .iof-guide-post .iof-layer-flow,
  .iof-guide-post .iof-canon,
  .iof-guide-post .iof-lifecycle {
    grid-template-columns: 1fr;
  }

  .iof-guide-post .iof-card { min-height: 0; }

  .iof-guide-post .iof-lineage-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .iof-guide-post .iof-lineage-svg { min-width: 720px; }
}
