.page-home {
  --home-rail-w: 240px;
  --home-code-accent: #A9560A;
  --home-paper-muted: #4A5560;
  background: var(--ink-900);
  color: var(--body-text);
  overflow-x: clip;
}

.page-home .home-hero {
  padding-block: 36px 60px;
  border-bottom: 1px solid var(--line-print);
  background:
    radial-gradient(1100px 520px at 78% -12%, rgba(47, 224, 200, .14), transparent 62%),
    radial-gradient(760px 420px at 4% 6%, rgba(255, 162, 58, .10), transparent 66%),
    linear-gradient(180deg, var(--ink-900), #0A1725 72%, var(--ink-900));
}

.page-home .home-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 34px;
}

@media (min-width: 980px) {
  .page-home .home-hero__grid {
    grid-template-columns: var(--home-rail-w) minmax(0, 1.6fr);
    gap: 52px;
    align-items: start;
  }
}

/* ---- 压缩导航列 ---- */
.page-home .home-rail {
  border: 1px solid var(--line-print);
  border-radius: var(--radius-md);
  background: var(--panel-800);
  padding: 18px 15px 16px;
}

@media (min-width: 980px) {
  .page-home .home-rail {
    position: sticky;
    top: 128px;
  }
}

.page-home .home-rail__eyebrow {
  margin: 0;
  color: var(--accent-cyan);
}

.page-home .home-rail__list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.page-home .home-rail__link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 9px;
  border-left: 2px solid transparent;
  color: var(--body-text);
  text-decoration: none;
  font-size: .9375rem;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.page-home .home-rail__link .mono {
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .12em;
}

.page-home .home-rail__link:hover,
.page-home .home-rail__link:focus-visible {
  background: rgba(255, 255, 255, .06);
  border-left-color: var(--accent-cyan);
  color: var(--white);
}

.page-home .home-rail__link[data-current="true"] {
  background: rgba(47, 224, 200, .10);
  border-left-color: var(--accent-cyan);
  color: var(--white);
}

.page-home .home-rail__link[data-current="true"] .mono {
  color: var(--accent-cyan);
}

.page-home .home-rail__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: .8125rem;
  color: var(--body-text);
}

.page-home .home-rail__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 0 4px rgba(47, 224, 200, .16);
}

.page-home .home-rail__meta {
  margin: 8px 0 0;
  font-size: .6875rem;
  color: var(--muted);
  letter-spacing: .1em;
}

/* ---- 首屏主区 ---- */
.page-home .home-hero__title {
  margin: 12px 0 0;
  color: var(--white);
  letter-spacing: -0.012em;
}

.page-home .home-hero__lede {
  max-width: 36em;
  margin: 16px 0 0;
  color: var(--body-text);
}

.page-home .home-search {
  position: relative;
  isolation: isolate;
  margin-top: 28px;
  padding: 22px 20px 20px;
  border: 1px solid var(--line-print);
  border-radius: var(--radius-md);
  background: linear-gradient(152deg, rgba(15, 36, 48, .94), rgba(8, 19, 31, .96));
  overflow: hidden;
}

.page-home .home-search__figure {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .24;
  pointer-events: none;
}

.page-home .home-search__ring {
  position: absolute;
  z-index: 1;
  top: -56px;
  right: -46px;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: 1px dashed rgba(47, 224, 200, .42);
  box-shadow:
    0 0 0 22px rgba(47, 224, 200, .055),
    0 0 0 48px rgba(255, 162, 58, .045);
  transition: border-color 220ms var(--ease), box-shadow 220ms var(--ease);
  pointer-events: none;
}

.page-home .home-search:focus-within .home-search__ring {
  border-color: var(--accent-amber);
  box-shadow:
    0 0 0 22px rgba(255, 162, 58, .12),
    0 0 0 48px rgba(47, 224, 200, .08);
}

.page-home .home-search__field,
.page-home .home-search__hint,
.page-home .home-search__samples {
  position: relative;
  z-index: 2;
}

.page-home .home-search__input {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 18px;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  color: var(--white);
  background: rgba(8, 19, 31, .78);
  border: 1px solid rgba(47, 224, 200, .42);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.page-home .home-search__input::placeholder {
  color: var(--muted);
}

.page-home .home-search__input:focus {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 3px rgba(255, 162, 58, .16);
}

.page-home .home-search__hint {
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}

.page-home .home-search__samples {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-home .home-search__samples li {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-print);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  font-size: .8125rem;
  color: var(--muted);
}

.page-home .home-search__samples .mono {
  color: var(--white);
  font-size: .8125rem;
  letter-spacing: .1em;
}

.page-home .home-search__samples em {
  font-style: normal;
}

/* ---- 首屏章节预览卡 ---- */
.page-home .home-hero__cards {
  margin-top: 22px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
  .page-home .home-hero__cards {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  }
}

.page-home .home-preview {
  display: grid;
  gap: 8px;
  padding: 20px 18px;
  border: 1px solid var(--line-print);
  border-radius: var(--radius-md);
  background: var(--panel-800);
  color: var(--body-text);
  text-decoration: none;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.page-home .home-preview--amber {
  border-left: 3px solid var(--accent-amber);
}

.page-home .home-preview--cyan {
  border-left: 3px solid var(--accent-cyan);
}

.page-home .home-preview:hover,
.page-home .home-preview:focus-visible {
  background: var(--panel-750);
  transform: translateY(-2px);
}

.page-home .home-preview__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--white);
}

.page-home .home-preview__desc {
  font-size: .875rem;
  line-height: 1.7;
  color: var(--muted);
}

/* ---- 章节标题通用 ---- */
.page-home .home-chapter {
  display: grid;
  gap: 10px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-print);
}

.page-home .home-chapter__note {
  max-width: 52ch;
  margin: 0;
  font-size: .9375rem;
  line-height: 1.75;
  color: var(--muted);
}

/* ---- 02 公告 ---- */
.page-home .home-bulletin__body {
  display: grid;
  gap: 28px;
}

@media (min-width: 900px) {
  .page-home .home-bulletin__body {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 44px;
    align-items: start;
  }
}

.page-home .home-bulletin__figure {
  margin: 0;
  border: 1px solid var(--line-amber);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.page-home .home-bulletin__figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.page-home .bulletin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-print);
}

.page-home .bulletin-item {
  border-bottom: 1px solid var(--line-print);
}

.page-home .bulletin-item a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label meta"
    "text text"
    "more more";
  gap: 10px 18px;
  padding: 22px 6px;
  text-decoration: none;
  color: inherit;
  transition: background var(--dur) var(--ease);
}

.page-home .bulletin-item a:hover,
.page-home .bulletin-item a:focus-visible {
  background: rgba(255, 162, 58, .055);
}

.page-home .bulletin-item .label-strip {
  grid-area: label;
  justify-self: start;
}

.page-home .bulletin-item__text {
  grid-area: text;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--white);
}

.page-home .bulletin-item__meta {
  grid-area: meta;
  font-size: .6875rem;
  letter-spacing: .12em;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.page-home .bulletin-item__more {
  grid-area: more;
  font-size: .875rem;
  line-height: 1.7;
  color: var(--muted);
  overflow: hidden;
}

@media (hover: hover) {
  .page-home .bulletin-item__more {
    max-height: 0;
    opacity: 0;
    transition: max-height 220ms var(--ease), opacity 220ms var(--ease);
  }

  .page-home .bulletin-item a:hover .bulletin-item__more,
  .page-home .bulletin-item a:focus-visible .bulletin-item__more {
    max-height: 5em;
    opacity: 1;
  }
}

.page-home .is-filtered-out {
  display: none;
}

/* ---- 03 专栏 ---- */
.page-home .home-columns__body {
  display: grid;
  gap: 28px;
}

@media (min-width: 900px) {
  .page-home .home-columns__body {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 44px;
    align-items: start;
  }
}

.page-home .column-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.page-home .column-item a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "tag time"
    "title title"
    "desc desc";
  gap: 9px 16px;
  padding: 20px 18px;
  border: 1px solid var(--line-print);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  background: var(--panel-800);
  text-decoration: none;
  color: inherit;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.page-home .column-item a:hover,
.page-home .column-item a:focus-visible {
  background: var(--panel-750);
  transform: translateY(-2px);
}

.page-home .column-item .label-strip {
  grid-area: tag;
  justify-self: start;
}

.page-home .column-item__time {
  grid-area: time;
  align-self: center;
  font-size: .6875rem;
  letter-spacing: .12em;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.page-home .column-item__title {
  grid-area: title;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--white);
}

.page-home .column-item__desc {
  grid-area: desc;
  font-size: .875rem;
  line-height: 1.75;
  color: var(--muted);
}

@media (hover: hover) {
  .page-home .column-item__time {
    opacity: 0;
    transition: opacity 200ms var(--ease);
  }

  .page-home .column-item a:hover .column-item__time,
  .page-home .column-item a:focus-visible .column-item__time {
    opacity: 1;
  }
}

.page-home .home-columns__figure {
  margin: 0;
  border: 1px solid var(--line-cyan);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.page-home .home-columns__figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ---- 04 榜单与收藏 ---- */
.page-home .home-matrix {
  border-top: 1px solid var(--line-print);
  border-bottom: 1px solid var(--line-print);
  background:
    linear-gradient(180deg, rgba(42, 46, 92, .5), rgba(8, 19, 31, .92)),
    var(--ink-900);
}

.page-home .home-matrix__figure {
  margin: 0 0 30px;
  border: 1px solid var(--line-print);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.page-home .home-matrix__figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 14 / 9;
  object-fit: cover;
}

.page-home .home-matrix__grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
  .page-home .home-matrix__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }
}

.page-home .matrix-col {
  padding: 18px 16px 20px;
  border: 1px solid var(--line-print);
  border-radius: var(--radius-md);
  background: rgba(15, 36, 48, .72);
}

.page-home .matrix-tag {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line-print);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--white);
}

.page-home .matrix-tag--rank {
  border-color: var(--wine-700);
  background: rgba(140, 36, 71, .22);
}

.page-home .matrix-tag--keep {
  border-color: var(--line-cyan);
  background: rgba(47, 224, 200, .13);
}

.page-home .matrix-tag--arch {
  border-color: var(--line-amber);
  background: rgba(255, 162, 58, .13);
}

.page-home .matrix-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.page-home .matrix-list li {
  display: grid;
  gap: 3px;
}

.page-home .matrix-list a {
  justify-self: start;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  color: var(--white);
  text-decoration: none;
  font-size: .9375rem;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.page-home .matrix-list a:hover,
.page-home .matrix-list a:focus-visible {
  border-bottom-color: var(--accent-cyan);
}

.page-home .matrix-list span {
  font-size: .8125rem;
  line-height: 1.7;
  color: var(--muted);
}

/* ---- 05 编号说明（纸色长读） ---- */
.page-home .home-code {
  background: var(--paper);
  color: var(--ink-text);
}

.page-home .home-code .home-chapter {
  border-bottom-color: rgba(18, 26, 34, .18);
}

.page-home .home-code .home-chapter__note {
  color: var(--home-paper-muted);
}

.page-home .home-code .eyebrow {
  color: #6B5642;
}

.page-home .home-code .section-num {
  color: var(--home-code-accent);
}

.page-home .code-break {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 860px) {
  .page-home .code-break {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 44px;
    align-items: start;
  }
}

.page-home .code-break__full {
  display: block;
  padding: 22px 16px;
  border: 1px solid rgba(18, 26, 34, .22);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .6);
  color: var(--ink-text);
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  font-weight: 500;
  letter-spacing: .08em;
  text-align: center;
  white-space: nowrap;
}

.page-home .code-break__parts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  .page-home .code-break__parts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
}

.page-home .code-break__parts li {
  display: grid;
  gap: 7px;
  padding-top: 16px;
  border-top: 2px solid var(--ink-text);
}

.page-home .code-break__parts .mono {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--ink-text);
}

.page-home .code-break__parts strong {
  font-size: .9375rem;
  color: var(--ink-text);
}

.page-home .code-break__parts p {
  margin: 0;
  font-size: .875rem;
  line-height: 1.7;
  color: var(--home-paper-muted);
}

.page-home .code-note {
  margin: 30px 0 0;
  padding: 16px 18px;
  border-left: 3px solid var(--home-code-accent);
  background: rgba(255, 255, 255, .55);
  font-size: .9375rem;
  line-height: 1.8;
  color: #2B3540;
}

.page-home .code-note .mono {
  color: var(--ink-text);
  font-weight: 500;
  letter-spacing: .1em;
}

/* ---- 06 人工协助 ---- */
.page-home .home-help__grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 860px) {
  .page-home .home-help__grid {
    grid-template-columns: minmax(0, 1fr) 260px;
    grid-template-areas:
      "head actions"
      "steps steps";
    gap: 30px 48px;
    align-items: center;
  }

  .page-home .home-help__head { grid-area: head; }
  .page-home .home-help__actions { grid-area: actions; justify-self: end; }
  .page-home .home-help__steps { grid-area: steps; }
}

.page-home .home-help__lede {
  max-width: 44ch;
  margin: 14px 0 0;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--body-text);
}

.page-home .home-help__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.page-home .home-help__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
  .page-home .home-help__steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
}

.page-home .home-help__steps li {
  display: grid;
  gap: 8px;
  padding: 18px 16px;
  border: 1px solid var(--line-print);
  border-radius: var(--radius-md);
  background: var(--panel-800);
}

.page-home .home-help__steps .mono {
  font-size: .6875rem;
  letter-spacing: .12em;
  color: var(--accent-amber);
}

.page-home .home-help__steps strong {
  font-size: 1rem;
  color: var(--white);
}

.page-home .home-help__steps p {
  margin: 0;
  font-size: .875rem;
  line-height: 1.75;
  color: var(--muted);
}

/* ---- 减动效 ---- */
@media (prefers-reduced-motion: reduce) {
  .page-home .home-preview,
  .page-home .column-item a,
  .page-home .home-search__ring {
    transition: none;
  }

  .page-home .home-preview:hover,
  .page-home .column-item a:hover {
    transform: none;
  }

  .page-home .bulletin-item__more,
  .page-home .column-item__time {
    max-height: none;
    opacity: 1;
  }
}
