.page-home .first-journey {
  position: relative;
  margin: 14px 0 76px;
  scroll-margin-top: 28px;
}

.page-home .first-journey[data-view="minimized"] { margin-bottom: 42px; }
.page-home .first-journey[data-view="hidden"] { margin-bottom: 28px; }

.page-home .fj-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(111, 153, 255, .34);
  background:
    linear-gradient(135deg, rgba(65, 114, 238, .14), transparent 42%),
    var(--glass-bg, rgba(10, 17, 31, .88));
  box-shadow:
    0 28px 70px rgba(0, 0, 0, .24),
    inset 0 1px 0 rgba(255, 255, 255, .05);
  border-radius: var(--radius-lg, 22px);
}

.page-home .fj-frame::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .5;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(101, 146, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 146, 255, .07) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 72%);
  mask-image: linear-gradient(90deg, #000, transparent 72%);
}

.page-home .fj-frame::after {
  content: "";
  position: absolute;
  top: 0;
  right: 28px;
  width: 52px;
  height: 3px;
  background: var(--accent-cyan, #35e0ff);
  opacity: .72;
}

.page-home .fj-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 36px;
  padding: 34px 38px 28px;
  border-bottom: 1px solid rgba(120, 156, 245, .17);
}

.page-home .fj-head-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.page-home .fj-kicker {
  display: block;
  margin-bottom: 12px;
  color: var(--accent-cyan, #35e0ff);
  font: 600 10px/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .24em;
}

.page-home .fj-title {
  margin: 0;
  color: var(--ink, #e6ecf7);
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.2;
  letter-spacing: -.03em;
}

.page-home .fj-intro {
  max-width: 700px;
  margin: 13px 0 0;
  color: var(--muted, #8a97b1);
  font-size: 13px;
  line-height: 1.8;
}

.page-home .fj-status {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 250px;
  padding: 9px 12px;
  border: 1px solid rgba(121, 160, 255, .22);
  border-radius: var(--radius-pill, 999px);
  background: rgba(51, 91, 179, .1);
  color: var(--muted, #8a97b1);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: .08em;
}

.page-home .fj-status i {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan, #35e0ff);
  box-shadow: 0 0 14px rgba(53, 224, 255, .8);
}

.page-home .fj-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.page-home .fj-view-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(121, 160, 255, .22);
  border-radius: 10px;
  background: rgba(51, 91, 179, .08);
  color: var(--muted, #8a97b1);
  cursor: pointer;
  font: inherit;
  transition: color .22s ease, border-color .22s ease, background-color .22s ease, transform .22s ease;
}

.page-home .fj-view-control span {
  color: var(--accent-cyan, #35e0ff);
  font: 600 14px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.page-home .fj-view-control b {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .06em;
}

.page-home .fj-view-control:hover,
.page-home .fj-view-control:focus-visible {
  outline: none;
  border-color: rgba(53, 224, 255, .58);
  background: rgba(53, 224, 255, .08);
  color: var(--ink, #e6ecf7);
  transform: translateY(-1px);
}

.page-home .fj-view-control--primary {
  border-color: rgba(53, 224, 255, .42);
  color: var(--ink, #e6ecf7);
}

/* 最小化状态：保留标题、当前进度和恢复入口，不重复渲染任务内容。 */
.page-home .fj-frame--minimized::before {
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 86%);
  mask-image: linear-gradient(90deg, #000, transparent 86%);
}

.page-home .fj-mini {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, .55fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 92px;
  padding: 18px 22px 18px 26px;
}

.page-home .fj-mini .fj-kicker { margin-bottom: 7px; }

.page-home .fj-mini__title {
  margin: 0;
  color: var(--ink, #e6ecf7);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.35;
}

.page-home .fj-mini__progress {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding-left: 20px;
  border-left: 1px solid rgba(120, 156, 245, .18);
}

.page-home .fj-mini__progress span {
  color: var(--accent-cyan, #35e0ff);
  font: 600 9px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .16em;
}

.page-home .fj-mini__progress b {
  overflow: hidden;
  color: var(--muted, #8a97b1);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 隐藏状态仍留下低干扰恢复栏，避免用户无法找回首次任务。 */
.page-home .fj-restore {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 54px;
  padding: 10px 16px;
  border: 1px dashed rgba(121, 160, 255, .28);
  border-radius: var(--radius-md, 14px);
  background: rgba(51, 91, 179, .05);
  color: var(--muted, #8a97b1);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: color .22s ease, border-color .22s ease, background-color .22s ease;
}

.page-home .fj-restore__signal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan, #35e0ff);
  font: 600 9px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .14em;
}

.page-home .fj-restore__signal i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px rgba(53, 224, 255, .72);
}

.page-home .fj-restore strong {
  overflow: hidden;
  color: var(--ink, #e6ecf7);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-home .fj-restore__action {
  color: var(--muted, #8a97b1);
  font-size: 10px;
  letter-spacing: .08em;
}

.page-home .fj-restore__action b { color: var(--accent-cyan, #35e0ff); font-size: 13px; }

.page-home .fj-restore:hover,
.page-home .fj-restore:focus-visible {
  outline: none;
  border-color: rgba(53, 224, 255, .58);
  background: rgba(53, 224, 255, .06);
  color: var(--ink, #e6ecf7);
}

.page-home .fj-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid rgba(120, 156, 245, .17);
}

.page-home .fj-step {
  position: relative;
  min-width: 0;
  padding: 16px 22px 18px;
  color: var(--muted, #8a97b1);
}

.page-home .fj-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: rgba(120, 156, 245, .14);
}

.page-home .fj-step span {
  display: block;
  margin-bottom: 5px;
  color: inherit;
  font: 600 9px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .2em;
  opacity: .72;
}

.page-home .fj-step b {
  display: block;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-home .fj-step.is-active {
  background: linear-gradient(90deg, rgba(73, 126, 255, .2), rgba(73, 126, 255, .04));
  color: var(--ink, #e6ecf7);
}

.page-home .fj-step.is-active::before,
.page-home .fj-step.is-done::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: var(--accent, #4d8dff);
}

.page-home .fj-step.is-done {
  color: var(--accent-cyan, #35e0ff);
}

.page-home .fj-step.is-done::before {
  background: rgba(53, 224, 255, .58);
}

.page-home .fj-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, .75fr);
  gap: 1px;
  background: rgba(120, 156, 245, .14);
}

.page-home .fj-topic-area,
.page-home .fj-brief {
  min-width: 0;
  background: rgba(7, 13, 25, .94);
}

.page-home .fj-topic-area {
  padding: 30px 32px 34px;
}

.page-home .fj-section-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
}

.page-home .fj-section-label span {
  color: var(--accent-cyan, #35e0ff);
  font: 600 10px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.page-home .fj-section-label b {
  color: var(--ink, #e6ecf7);
  font-size: 13px;
  letter-spacing: .08em;
}

.page-home .fj-section-label small {
  margin-left: auto;
  color: var(--muted, #8a97b1);
  font-size: 10px;
}

.page-home .fj-topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.page-home .fj-topic {
  position: relative;
  min-height: 142px;
  padding: 18px 18px 42px;
  border: 1px solid rgba(126, 158, 232, .18);
  border-radius: var(--radius-md, 14px);
  background: rgba(42, 62, 104, .12);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform .28s cubic-bezier(.22, 1, .36, 1),
    border-color .28s ease,
    background-color .28s ease;
}

.page-home .fj-topic:hover,
.page-home .fj-topic:focus-visible {
  z-index: 1;
  outline: none;
  border-color: rgba(77, 141, 255, .72);
  background: rgba(62, 100, 188, .18);
  transform: translateY(-3px);
}

.page-home .fj-topic.is-selected {
  border-color: var(--accent-cyan, #35e0ff);
  background:
    linear-gradient(135deg, rgba(53, 224, 255, .13), transparent 62%),
    rgba(39, 80, 158, .16);
  box-shadow: inset 3px 0 0 var(--accent-cyan, #35e0ff);
}

.page-home .fj-topic__code {
  display: block;
  margin-bottom: 12px;
  color: var(--muted, #8a97b1);
  font: 600 9px/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .16em;
}

.page-home .fj-topic strong {
  display: block;
  color: var(--ink, #e6ecf7);
  font-size: 17px;
  font-weight: 650;
}

.page-home .fj-topic__lead {
  display: block;
  margin-top: 7px;
  color: var(--muted, #8a97b1);
  font-size: 11px;
  line-height: 1.65;
}

.page-home .fj-topic i {
  position: absolute;
  right: 14px;
  bottom: 13px;
  color: var(--accent, #4d8dff);
  font-size: 9px;
  font-style: normal;
  letter-spacing: .14em;
}

.page-home .fj-topic.is-selected i {
  color: var(--accent-cyan, #35e0ff);
}

.page-home .fj-brief {
  display: flex;
  flex-direction: column;
  padding: 30px 28px;
}

.page-home .fj-brief__index {
  color: var(--accent, #4d8dff);
  font: 600 9px/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .18em;
}

.page-home .fj-brief h3 {
  margin: 17px 0 10px;
  color: var(--ink, #e6ecf7);
  font-size: 22px;
  line-height: 1.25;
}

.page-home .fj-brief > p {
  margin: 0;
  color: var(--muted, #8a97b1);
  font-size: 12px;
  line-height: 1.8;
}

.page-home .fj-meta {
  display: grid;
  gap: 1px;
  margin: 24px 0;
  background: rgba(126, 158, 232, .14);
}

.page-home .fj-meta div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 11px;
  border-radius: var(--radius-md, 14px);
  background: rgba(9, 16, 29, .95);
}

.page-home .fj-meta dt,
.page-home .fj-meta dd {
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
}

.page-home .fj-meta dt {
  color: var(--muted, #8a97b1);
}

.page-home .fj-meta dd {
  color: var(--ink, #e6ecf7);
  text-align: right;
}

.page-home .fj-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  width: 100%;
  min-height: 54px;
  margin-top: auto;
  padding: 0 17px;
  border: 1px solid var(--accent, #4d8dff);
  border-radius: var(--radius-md, 14px);
  background: var(--accent, #4d8dff);
  color: #fff;
  font: 600 12px/1.2 "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: .08em;
  text-decoration: none;
  cursor: pointer;
  transition:
    filter .25s ease,
    transform .25s cubic-bezier(.22, 1, .36, 1);
}

.page-home .fj-cta:not(:disabled):hover,
.page-home .fj-cta:not(:disabled):focus-visible {
  outline: none;
  filter: brightness(1.12);
  transform: translateY(-2px);
}

.page-home .fj-cta:disabled {
  border-color: rgba(126, 158, 232, .2);
  background: rgba(51, 72, 116, .24);
  color: var(--muted, #8a97b1);
  cursor: not-allowed;
}

.page-home .fj-cta span {
  font-size: 18px;
}

.page-home .fj-reset {
  align-self: center;
  min-height: 42px;
  margin: 9px 0 0;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted, #8a97b1);
  font: inherit;
  font-size: 10px;
  letter-spacing: .08em;
  cursor: pointer;
}

.page-home .fj-reset:hover,
.page-home .fj-reset:focus-visible {
  outline: none;
  color: var(--ink, #e6ecf7);
}

.page-home .fj-local,
.page-home .fj-storage-warn {
  display: block;
  margin-top: 12px;
  color: var(--muted, #8a97b1);
  font-size: 9px;
  line-height: 1.55;
  letter-spacing: .04em;
}

.page-home .fj-storage-warn {
  color: #ffcf71 !important;
}

.page-home .fj-unavailable {
  padding: 28px;
  border: 1px solid rgba(255, 207, 113, .35);
  color: #ffcf71;
  font-size: 12px;
}

[data-theme="light"] .page-home .fj-frame {
  background:
    linear-gradient(135deg, rgba(73, 126, 255, .1), transparent 44%),
    rgba(247, 250, 255, .97);
  box-shadow: 0 28px 60px rgba(64, 83, 122, .12);
}

[data-theme="light"] .page-home .fj-topic-area,
[data-theme="light"] .page-home .fj-brief,
[data-theme="light"] .page-home .fj-meta div {
  background: rgba(248, 250, 255, .97);
}

@media (max-width: 820px) {
  .page-home .first-journey {
    margin: 4px 0 52px;
  }

  .page-home .fj-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 18px;
    padding: 26px 22px 22px;
  }

  .page-home .fj-head-side {
    width: 100%;
    justify-items: stretch;
  }

  .page-home .fj-head-side .fj-controls { justify-content: flex-start; }

  .page-home .fj-title {
    font-size: clamp(24px, 8vw, 34px);
  }

  .page-home .fj-status {
    max-width: none;
  }

  .page-home .fj-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-home .fj-step {
    padding: 13px 14px 15px;
  }

  .page-home .fj-step:nth-child(2)::after {
    display: none;
  }

  .page-home .fj-step:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(120, 156, 245, .14);
  }

  .page-home .fj-body {
    grid-template-columns: 1fr;
  }

  .page-home .fj-topic-area {
    padding: 24px 20px 26px;
  }

  .page-home .fj-section-label {
    flex-wrap: wrap;
  }

  .page-home .fj-section-label small {
    flex-basis: 100%;
    margin-left: 26px;
    line-height: 1.5;
  }

  .page-home .fj-brief {
    padding: 25px 21px 24px;
  }

  .page-home .fj-cta {
    min-height: 52px;
    margin-top: 0;
  }

  .page-home .fj-mini {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 12px;
    padding: 18px 18px 17px;
  }

  .page-home .fj-mini__progress {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 12px 0 0;
    border-top: 1px solid rgba(120, 156, 245, .18);
    border-left: 0;
  }

  .page-home .fj-mini__progress b { white-space: normal; }
}

@media (max-width: 520px) {
  .page-home .fj-topics {
    grid-template-columns: 1fr;
  }

  .page-home .fj-topic {
    min-height: 126px;
  }

  .page-home .fj-mini {
    grid-template-columns: 1fr;
  }

  .page-home .fj-mini .fj-controls {
    grid-row: 2;
    justify-content: flex-start;
  }

  .page-home .fj-mini__progress { grid-row: 3; }

  .page-home .fj-restore {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
  }

  .page-home .fj-restore__signal { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .page-home .fj-topic,
  .page-home .fj-cta,
  .page-home .fj-view-control,
  .page-home .fj-restore {
    transition: none;
  }
}

/* ---------- 主线游戏任选卡（首页 fj-brief 内） ---------- */
.page-home .fj-games {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.page-home .fj-game {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 86px 12px 14px;
  border: 1px solid rgba(126, 158, 232, .18);
  border-radius: var(--radius-md, 14px);
  background: rgba(42, 62, 104, .12);
  color: inherit;
  text-decoration: none;
  transition:
    transform .28s cubic-bezier(.22, 1, .36, 1),
    border-color .28s ease,
    background-color .28s ease;
}
.page-home .fj-game:hover,
.page-home .fj-game:focus-visible {
  outline: none;
  border-color: rgba(77, 141, 255, .72);
  background: rgba(62, 100, 188, .18);
  transform: translateY(-2px);
}
.page-home .fj-game.is-selected {
  border-color: var(--accent-cyan, #35e0ff);
  background:
    linear-gradient(135deg, rgba(53, 224, 255, .13), transparent 62%),
    rgba(39, 80, 158, .16);
  box-shadow: inset 3px 0 0 var(--accent-cyan, #35e0ff);
}
.page-home .fj-game strong {
  color: var(--ink, #e6ecf7);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.page-home .fj-game span {
  color: var(--muted, #8a97b1);
  font-size: 10px;
  letter-spacing: .06em;
}
.page-home .fj-game i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent, #4d8dff);
  font-size: 10px;
  font-style: normal;
  letter-spacing: .1em;
  white-space: nowrap;
}
.page-home .fj-game.is-selected i {
  color: var(--accent-cyan, #35e0ff);
}

/* ---------- A9 分层引导：游戏卡难度星级与默认推荐 ---------- */
.page-home .fj-game {
  flex-wrap: wrap;
}
.page-home .fj-game__stars {
  color: var(--accent-cyan, #35e0ff);
  font-weight: 400;
  letter-spacing: .12em;
}
.page-home .fj-game__rec {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid rgba(53, 224, 255, .45);
  border-radius: 999px;
  color: var(--accent-cyan, #35e0ff);
  font-size: 9px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: .08em;
  white-space: nowrap;
  vertical-align: 2px;
}
.page-home .fj-games-tip {
  margin: 10px 2px 0;
  color: var(--muted, #8a97b1);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: .04em;
}
[data-theme="light"] .page-home .fj-game__rec {
  border-color: rgba(12, 148, 178, .5);
  color: #0c94b2;
}
