.page-community-rules {
  background: var(--color-surface);
  color: var(--color-ink);
}

/* ---------- 首屏 ---------- */
.page-community-rules .rules-head {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--color-contrast-surface);
  color: var(--color-contrast-ink);
  padding: var(--space-6) 0 var(--section-y);
}

.page-community-rules .rules-head__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}

.page-community-rules .rules-head__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--overlay-scrim);
}

.page-community-rules .rules-head__inner {
  position: relative;
  z-index: 2;
}

.page-community-rules .rules-head .breadcrumb {
  margin-bottom: var(--space-4);
  color: var(--color-contrast-ink);
}

.page-community-rules .rules-head .breadcrumb a {
  color: var(--color-contrast-ink);
  text-decoration: none;
  border-bottom: var(--border-thin) solid var(--color-contrast-line);
  padding-bottom: 1px;
}

.page-community-rules .rules-head .breadcrumb a:hover,
.page-community-rules .rules-head .breadcrumb a:focus-visible {
  border-bottom-color: var(--color-contrast-accent);
  color: var(--color-contrast-accent);
}

.page-community-rules .rules-head h1 {
  margin: var(--space-2) 0 var(--space-3);
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-3xl);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  max-width: 18ch;
  color: var(--color-contrast-ink);
}

.page-community-rules .rules-head__lede {
  max-width: 62ch;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-contrast-ink);
  margin: 0 0 var(--space-3);
}

.page-community-rules .rules-head__meta {
  margin: 0;
  padding-top: var(--space-2);
  border-top: var(--border-thin) solid var(--color-contrast-line);
  max-width: 74ch;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--color-contrast-accent);
}

/* ---------- 通用区块 ---------- */
.page-community-rules .rules-band {
  padding: var(--space-8) 0;
  border-bottom: var(--border-thin) solid var(--color-line);
}

.page-community-rules .rules-band--alt {
  background: var(--color-surface-alt);
}

.page-community-rules .rules-band--deep {
  background: var(--color-contrast-surface);
  color: var(--color-contrast-ink);
  border-bottom-color: var(--color-contrast-line);
}

.page-community-rules .band-head {
  max-width: 74ch;
  margin-bottom: var(--space-6);
}

.page-community-rules .band-head h2 {
  margin: var(--space-2) 0 var(--space-3);
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-2xl);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--color-ink);
}

.page-community-rules .band-head__lede {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-ink-soft);
}

.page-community-rules .band-head--deep h2 {
  color: var(--color-contrast-ink);
}

.page-community-rules .band-head--deep .band-head__lede {
  color: var(--color-contrast-ink);
}

.page-community-rules .eyebrow--deep {
  color: var(--color-contrast-accent);
}

/* ---------- 话题归属 ---------- */
.page-community-rules .where-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-community-rules .where-item {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  background: var(--color-surface-alt);
  border: var(--border-thin) solid var(--color-line);
  border-left: var(--border-thick) solid var(--color-primary);
  border-radius: 0;
}

.page-community-rules .where-item__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--color-primary);
  text-transform: uppercase;
}

.page-community-rules .where-item__body {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--color-ink-soft);
  max-width: 74ch;
}

.page-community-rules .where-item__body a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: var(--border-thin) solid currentColor;
}

.page-community-rules .where-item__body a:hover,
.page-community-rules .where-item__body a:focus-visible {
  color: var(--color-focus);
}

/* ---------- 边界分屏 ---------- */
.page-community-rules .boundary-split {
  display: grid;
  gap: var(--space-6);
}

.page-community-rules .boundary-split__media {
  margin: 0;
  border: var(--border-thin) solid var(--color-line);
  background: var(--color-surface-deep);
  align-self: start;
}

.page-community-rules .boundary-split__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.page-community-rules .boundary-split__media figcaption {
  padding: var(--space-2) var(--space-3);
  border-top: var(--border-thin) solid var(--color-line);
  font-size: var(--text-xs);
  line-height: var(--leading-body);
  color: var(--color-ink-muted);
}

/* ---------- 规则列表 ---------- */
.page-community-rules .rule-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: var(--border-thin) solid var(--color-line);
}

.page-community-rules .rule-entry {
  display: grid;
  grid-template-columns: calc(var(--space-6) + var(--space-2)) 1fr;
  border-top: var(--border-thin) solid var(--color-line);
}

.page-community-rules .rule-entry__num {
  padding: var(--space-4) var(--space-2) var(--space-4) 0;
  border-right: var(--border-thin) solid var(--color-line);
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--weight-heading);
  line-height: 1;
  color: var(--color-primary);
  letter-spacing: 0.02em;
}

.page-community-rules .rule-entry:nth-child(even) .rule-entry__num {
  color: var(--color-accent);
}

.page-community-rules .rule-entry__body {
  padding: var(--space-4) 0 var(--space-4) var(--space-3);
}

.page-community-rules .rule-entry__body h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-lg);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--color-ink);
}

.page-community-rules .rule-entry__when {
  margin: 0 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  color: var(--color-ink-muted);
}

.page-community-rules .rule-entry__body > p {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--color-ink-soft);
  max-width: 74ch;
}

.page-community-rules .rule-entry__alt {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--color-primary-soft);
  border-left: var(--border-thick) solid var(--color-primary);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--color-ink);
  max-width: 74ch;
}

/* ---------- 冲突处理流程 ---------- */
.page-community-rules .flow-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 74ch;
}

.page-community-rules .flow-step {
  position: relative;
  padding-left: calc(var(--space-6) + var(--space-1));
  padding-bottom: var(--space-6);
}

.page-community-rules .flow-step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: var(--space-2);
  height: var(--space-2);
  background: var(--color-contrast-accent);
  border-radius: var(--radius-sm);
}

.page-community-rules .flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(var(--space-2) / 2);
  top: calc(0.3em + var(--space-2) + var(--space-1));
  bottom: 0;
  width: var(--border-thin);
  background: var(--color-contrast-line);
}

.page-community-rules .flow-step:last-child {
  padding-bottom: 0;
}

.page-community-rules .flow-step__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.page-community-rules .flow-step__idx {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: var(--color-contrast-accent);
}

.page-community-rules .flow-step__head h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-xl);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--color-contrast-ink);
}

.page-community-rules .flow-step > p {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-contrast-ink);
}

.page-community-rules .flow-step__hint {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-left: var(--space-3);
  border-left: var(--border-thin) solid var(--color-contrast-line);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--color-contrast-accent);
  transition: max-height 200ms linear, opacity 200ms linear, margin-top 200ms linear;
}

.page-community-rules .flow-step:hover .flow-step__hint,
.page-community-rules .flow-step:focus-within .flow-step__hint {
  max-height: 12em;
  opacity: 1;
  margin-top: var(--space-2);
}

/* ---------- 处理之后 ---------- */
.page-community-rules .after-grid {
  display: grid;
  gap: var(--space-2);
}

.page-community-rules .after-card {
  padding: var(--space-3);
  border: var(--border-thin) solid var(--color-line);
  background: var(--color-surface-alt);
}

.page-community-rules .after-card__k {
  margin: 0 0 var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: var(--border-thin) solid var(--color-line);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

.page-community-rules .after-card > p:last-child {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--color-ink-soft);
}

.page-community-rules .after-card a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: var(--border-thin) solid currentColor;
}

.page-community-rules .after-card a:hover,
.page-community-rules .after-card a:focus-visible {
  color: var(--color-focus);
}

/* ---------- 结尾返回 ---------- */
.page-community-rules .rules-back {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--color-contrast-surface);
  color: var(--color-contrast-ink);
  padding: var(--space-8) 0;
}

.page-community-rules .rules-back__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
}

.page-community-rules .rules-back__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--overlay-scrim);
}

.page-community-rules .rules-back__inner {
  position: relative;
  z-index: 2;
  max-width: 74ch;
}

.page-community-rules .rules-back h2 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-2xl);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--color-contrast-ink);
}

.page-community-rules .rules-back__inner > p {
  margin: 0 0 var(--space-4);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-contrast-ink);
}

.page-community-rules .rules-back__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.page-community-rules .rules-back__foot {
  margin: 0;
  padding-top: var(--space-3);
  border-top: var(--border-thin) solid var(--color-contrast-line);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--color-contrast-ink);
}

.page-community-rules .rules-back__foot a {
  color: var(--color-contrast-accent);
  text-decoration: none;
  border-bottom: var(--border-thin) solid currentColor;
}

.page-community-rules .rules-back__foot a:hover,
.page-community-rules .rules-back__foot a:focus-visible {
  color: var(--color-contrast-ink);
}

/* ---------- 桌面端 ---------- */
@media (min-width: 768px) {
  .page-community-rules .rules-head {
    padding: var(--space-8) 0 var(--section-y-lg);
  }

  .page-community-rules .rules-head h1 {
    font-size: var(--text-4xl);
    max-width: 20ch;
  }

  .page-community-rules .where-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .page-community-rules .after-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }
}

@media (min-width: 1024px) {
  .page-community-rules .rules-head {
    padding: var(--space-8) 0 var(--section-y-lg);
  }

  .page-community-rules .rules-head h1 {
    max-width: 22ch;
  }

  .page-community-rules .rules-band {
    padding: var(--section-y-lg) 0;
  }

  .page-community-rules .boundary-split {
    grid-template-columns: 4fr 7fr;
    gap: var(--space-6);
    align-items: start;
  }

  .page-community-rules .boundary-split__media {
    position: sticky;
    top: calc(72px + var(--space-6));
  }

  .page-community-rules .after-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .page-community-rules .rules-back {
    padding: var(--section-y-lg) 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-community-rules .flow-step__hint {
    transition: none;
  }
}
</main>
