.nested-mini {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fbf9ff;
}

.nested-mini-shape {
  display: grid;
  grid-template-columns: repeat(3, 15px);
  grid-auto-rows: 15px;
  gap: 3px;
}

.nested-mini-shape i,
.nested-mini-shape b {
  width: 15px;
  height: 15px;
}

.nested-mini-shape i {
  visibility: hidden;
}

.nested-mini-shape b {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-size: 7px;
  font-style: normal;
}

.nested-mini-label {
  position: absolute;
  right: 8px;
  bottom: 7px;
  padding: 3px 6px;
  color: #6f5000;
  background: var(--yellow);
  font-size: 9px;
  font-weight: 850;
}

.nested-entry-shell {
  width: min(100%, 640px);
  overflow-x: clip;
}

.nested-cover-topbar {
  flex: 0 0 auto;
  font-weight: 850;
}

.nested-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 30px;
  padding: 18px 0 12px;
}

.nested-hero > div:first-child {
  min-width: 0;
}

.nested-hero .brand-mark {
  margin-bottom: 13px;
}

.nested-hero .product-title {
  font-size: 16px;
}

.nested-title {
  margin: 9px 0 15px;
  color: var(--teal-dark);
  font-size: 48px;
  font-weight: 900;
  line-height: 1.08;
  animation: nested-title-in 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nested-title span {
  color: #b87900;
}

.nested-hero .lead {
  font-size: 13px;
  line-height: 1.72;
}

.nested-cover-visual {
  min-height: 230px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 17px;
  border: 2px solid #d8caef;
  border-bottom: 5px solid var(--yellow);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(109, 40, 217, 0.14);
  animation: nested-cover-float 5s ease-in-out infinite;
}

.nested-cover-visual > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.nested-digit {
  --dot-size: 30px;
  --dot-gap: 5px;
  display: grid;
  grid-template-columns: repeat(3, var(--dot-size));
  grid-auto-rows: var(--dot-size);
  gap: var(--dot-gap);
  width: max-content;
  height: max-content;
}

.nested-digit b,
.nested-digit i {
  width: var(--dot-size);
  height: var(--dot-size);
}

.nested-digit i {
  visibility: hidden;
}

.nested-digit b {
  display: grid;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--dot-color) 78%, #000);
  border-radius: 50%;
  color: var(--dot-ink);
  background: var(--dot-color);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 2px 0 color-mix(in srgb, var(--dot-color) 66%, #000);
  font-size: calc(var(--dot-size) * 0.46);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.nested-digit.cover {
  --dot-size: 24px;
  --dot-gap: 4px;
}

.nested-guide-shell {
  width: min(100%, 670px);
}

.nested-guide-intro {
  padding-bottom: 26px;
}

.nested-guide-foundation {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 26px;
  margin: 14px 0 20px;
  padding: 21px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fdfcff;
}

.nested-digit.guide {
  --dot-size: 26px;
  --dot-gap: 4px;
  justify-self: center;
}

.nested-guide-foundation > div {
  display: grid;
  gap: 4px;
}

.nested-guide-foundation strong {
  margin-top: 8px;
  color: var(--teal-dark);
  font-size: 16px;
}

.nested-guide-foundation span {
  color: var(--muted);
  font-size: 11px;
}

.nested-guide-double {
  display: grid;
  grid-template-columns: 1fr 100px 1fr;
  align-items: center;
  gap: 10px;
  margin: 13px 0 20px;
}

.nested-guide-double > span {
  min-height: 78px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid #ded4f2;
  border-radius: 7px;
  color: var(--muted);
  background: var(--purple-soft);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.nested-guide-double strong {
  color: var(--teal-dark);
  font-size: 15px;
}

.nested-guide-double > i {
  color: #9c7100;
  font-size: 22px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.nested-rule-demo,
.nested-rule-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.nested-rule-demo {
  margin: 13px 0 20px;
}

.nested-rule-demo > span,
.nested-rule-bar > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  border-radius: 6px;
  font-weight: 800;
}

.nested-rule-demo > span {
  min-height: 62px;
  border: 1px solid var(--line);
  font-size: 12px;
}

.nested-rule-demo i,
.nested-rule-bar i {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.nested-rule-demo .color i,
.nested-rule-bar .color i {
  background: linear-gradient(
    90deg,
    #e5484d 0 25%,
    #2878d0 25% 50%,
    #168b61 50% 75%,
    #ffd400 75%
  );
}

.nested-rule-demo .black i,
.nested-rule-bar .black i {
  background: #202124;
}

.nested-game-shell {
  width: min(100%, 720px);
}

.nested-single-stage {
  position: relative;
  min-height: 330px;
  display: grid;
  place-items: center;
  padding: 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fdfcff;
}

.nested-digit.single {
  --dot-size: 44px;
  --dot-gap: 7px;
  animation: nested-digit-in 360ms cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

.nested-double-stage {
  position: relative;
  min-height: 330px;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 24px 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fdfcff;
}

.nested-operand {
  min-width: 0;
  max-width: 240px;
  flex: 1 1 0;
  display: grid;
  place-items: center;
  gap: 14px;
}

.nested-left-operand {
  order: 1;
}

.nested-operator {
  order: 2;
}

.nested-right-operand {
  order: 3;
}

.nested-operand > span {
  min-width: 78px;
  padding: 5px 9px;
  border-radius: 5px;
  color: #704d00;
  background: var(--gold-soft);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.nested-digit.double {
  --dot-size: 32px;
  --dot-gap: 5px;
  animation: nested-digit-in 360ms cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

.nested-operator {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid var(--yellow);
  border-radius: 50%;
  color: var(--teal-dark);
  background: #fff;
  box-shadow: 0 5px 15px rgba(109, 40, 217, 0.12);
  font-size: 29px;
}

.nested-answer-form input {
  text-align: center;
}

.nested-scan-shell {
  width: min(100%, 780px);
}

.nested-rule-bar {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f5f9;
}

.nested-rule-bar > span {
  min-height: 38px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
}

.nested-rule-bar .color {
  color: #6d28d9;
  border-bottom: 3px solid var(--yellow);
}

.nested-rule-bar .black {
  color: #202124;
  border-bottom: 3px solid #202124;
}

.nested-training-field {
  position: relative;
  width: 100%;
  min-height: 500px;
  overflow: hidden;
  border: 1px solid #d9d3dc;
  border-radius: 8px;
  background:
    linear-gradient(#f3f0f5 1px, transparent 1px),
    linear-gradient(90deg, #f3f0f5 1px, transparent 1px),
    #fff;
  background-size: 32px 32px;
  box-shadow: inset 0 0 28px rgba(48, 35, 58, 0.04);
}

.nested-stimulus {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  transition: opacity 100ms ease;
  animation: nested-stimulus-in 180ms cubic-bezier(0.22, 1.45, 0.36, 1)
    both;
}

.nested-stimulus.is-hidden {
  opacity: 0;
}

.nested-digit.scan {
  --dot-size: 23px;
  --dot-gap: 4px;
}

.nested-field-counter {
  position: absolute;
  right: 10px;
  bottom: 9px;
  padding: 4px 7px;
  border-radius: 4px;
  color: #655d68;
  background: rgba(255, 255, 255, 0.88);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.nested-count-stage {
  min-height: 300px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fdfcff;
  text-align: center;
}

.nested-count-mark {
  display: flex;
  align-items: flex-start;
  color: var(--teal-dark);
}

.nested-count-mark span {
  font-size: 96px;
  font-weight: 900;
  line-height: 1;
}

.nested-count-mark i {
  color: #b27b00;
  font-size: 38px;
  font-style: normal;
  font-weight: 900;
}

.nested-count-stage > strong {
  color: var(--teal-dark);
  font-size: 18px;
}

.nested-count-stage > span {
  color: var(--muted);
  font-size: 11px;
}

.nested-reveal-single,
.nested-reveal-expression {
  min-height: 112px;
  display: grid;
  grid-template-columns: auto 58px 32px auto 58px 32px 70px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fdfcff;
}

.nested-reveal-single span,
.nested-reveal-expression span {
  color: var(--muted);
  font-size: 10px;
}

.nested-reveal-single strong,
.nested-reveal-expression strong,
.nested-reveal-single b,
.nested-reveal-expression b {
  display: grid;
  min-height: 52px;
  place-items: center;
  border-radius: 6px;
  color: var(--teal-dark);
  background: var(--purple-soft);
  font-size: 27px;
}

.nested-reveal-single b,
.nested-reveal-expression b {
  color: #6f5000;
  background: var(--yellow);
}

.nested-reveal-single i,
.nested-reveal-expression i {
  color: #9c7100;
  font-size: 23px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.nested-six-breakdown {
  min-height: 150px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fdfcff;
}

.nested-six-breakdown > div {
  display: grid;
  place-items: center;
  gap: 5px;
}

.nested-six-breakdown > i {
  color: #9c7100;
  font-size: 24px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.nested-six-breakdown strong {
  color: var(--teal-dark);
  font-size: 34px;
}

.nested-six-breakdown small {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.nested-six-breakdown .color-dot,
.nested-six-breakdown .black-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.nested-six-breakdown .color-dot {
  background: linear-gradient(
    90deg,
    #e5484d 0 25%,
    #2878d0 25% 50%,
    #168b61 50% 75%,
    #ffd400 75%
  );
}

.nested-six-breakdown .black-dot {
  background: #202124;
}

.nested-six-breakdown .total {
  min-height: 88px;
  border: 2px solid var(--yellow);
  border-radius: 7px;
  background: var(--gold-soft);
}

@keyframes nested-title-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes nested-cover-float {
  50% {
    transform: translateY(-5px);
    box-shadow: 0 18px 34px rgba(109, 40, 217, 0.18);
  }
}

@keyframes nested-digit-in {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes nested-stimulus-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.78);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (max-width: 620px) {
  .nested-hero {
    grid-template-columns: minmax(0, 1fr) 148px;
    gap: 16px;
  }

  .nested-title {
    font-size: 42px;
  }

  .nested-cover-visual {
    min-height: 188px;
    padding: 12px;
  }

  .nested-digit.cover {
    --dot-size: 19px;
    --dot-gap: 3px;
  }

  .nested-single-stage,
  .nested-double-stage {
    min-height: 300px;
  }

  .nested-digit.single {
    --dot-size: 38px;
    --dot-gap: 6px;
  }

  .nested-double-stage {
    gap: 7px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .nested-digit.double {
    --dot-size: 27px;
    --dot-gap: 4px;
  }

  .nested-operator {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .nested-training-field {
    min-height: min(500px, calc(100dvh - 190px));
  }
}

@media (max-width: 480px) {
  .nested-hero {
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 10px;
  }

  .nested-hero .product-title {
    font-size: 13px;
  }

  .nested-title {
    font-size: 36px;
  }

  .nested-cover-visual {
    min-height: 158px;
    padding: 9px;
  }

  .nested-digit.cover {
    --dot-size: 15px;
    --dot-gap: 3px;
  }

  .nested-cover-visual > span {
    font-size: 8px;
  }

  .nested-guide-foundation {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 14px;
    padding: 15px 10px;
  }

  .nested-digit.guide {
    --dot-size: 21px;
    --dot-gap: 3px;
  }

  .nested-guide-double {
    grid-template-columns: 1fr 70px 1fr;
  }

  .nested-guide-double > i {
    font-size: 16px;
  }

  .nested-single-stage {
    min-height: 270px;
  }

  .nested-digit.single {
    --dot-size: 34px;
    --dot-gap: 5px;
  }

  .nested-double-stage {
    min-height: 270px;
  }

  .nested-digit.double {
    --dot-size: 23px;
    --dot-gap: 3px;
  }

  .nested-operand {
    gap: 10px;
  }

  .nested-operand > span {
    min-width: 68px;
  }

  .nested-training-field {
    min-height: min(470px, calc(100dvh - 185px));
    background-size: 28px 28px;
  }

  .nested-digit.scan {
    --dot-size: 20px;
    --dot-gap: 3px;
  }

  .nested-reveal-single,
  .nested-reveal-expression {
    grid-template-columns: auto 42px 22px auto 42px 22px 52px;
    gap: 5px;
    padding: 14px 7px;
  }

  .nested-reveal-single strong,
  .nested-reveal-expression strong,
  .nested-reveal-single b,
  .nested-reveal-expression b {
    min-height: 45px;
    font-size: 22px;
  }
}

@media (max-width: 360px) {
  .nested-hero {
    grid-template-columns: minmax(0, 1fr) 100px;
  }

  .nested-title {
    font-size: 32px;
  }

  .nested-cover-visual {
    min-height: 142px;
  }

  .nested-digit.cover {
    --dot-size: 13px;
    --dot-gap: 2px;
  }

  .nested-digit.single {
    --dot-size: 31px;
    --dot-gap: 4px;
  }

  .nested-double-stage {
    gap: 3px;
    padding-right: 5px;
    padding-left: 5px;
  }

  .nested-digit.double {
    --dot-size: 20px;
    --dot-gap: 3px;
  }

  .nested-operator {
    width: 36px;
    height: 36px;
    font-size: 21px;
  }

  .nested-operand > span {
    min-width: 58px;
    padding: 4px 5px;
    font-size: 9px;
  }

  .nested-digit.scan {
    --dot-size: 18px;
    --dot-gap: 3px;
  }

  .nested-training-field {
    min-height: min(430px, calc(100dvh - 180px));
  }

  .nested-reveal-single,
  .nested-reveal-expression {
    grid-template-columns: 36px 19px 36px 19px 46px;
  }

  .nested-reveal-single span,
  .nested-reveal-expression span {
    display: none;
  }

  .nested-six-breakdown {
    grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr);
    gap: 3px;
    padding: 12px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nested-cover-visual,
  .nested-title,
  .nested-digit,
  .nested-stimulus {
    animation: none !important;
  }
}

/* ===== 复合箭头：双向识别 / 角度对对碰 ===== */
.numbers-mode-groups {
  display: grid;
  gap: 13px;
}

.numbers-mode-group-title {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.numbers-mode-tabs.tabs-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nested-arrow-figure {
  --arrow-cell: 38px;
  display: grid;
  grid-template-columns: repeat(5, var(--arrow-cell));
  grid-auto-rows: var(--arrow-cell);
  gap: 5px;
  width: max-content;
  height: max-content;
}

.nested-arrow-figure i {
  visibility: hidden;
}

.nested-arrow-glyph {
  width: 100%;
  height: 100%;
  color: #6d28d9;
}

.nested-arrow-glyph path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.nested-arrows-stage {
  min-height: 320px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fdfcff;
}

.nested-arrows-stage .nested-arrow-figure {
  animation: nested-digit-in 360ms cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

.nested-direction-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 460px);
  margin: 0 auto;
}

.nested-direction-button {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 6px 9px;
  border: 2px solid #d8caef;
  border-radius: 10px;
  color: var(--teal-dark);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(109, 40, 217, 0.08);
  transition:
    transform 140ms cubic-bezier(0.22, 1.4, 0.36, 1),
    border-color 140ms ease,
    background 140ms ease;
}

.nested-direction-button .nested-arrow-glyph {
  width: 24px;
  height: 24px;
}

.nested-direction-button:hover {
  border-color: var(--yellow);
  background: var(--gold-soft);
}

.nested-direction-button:active {
  transform: scale(0.93);
}

.nested-angle-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 380px);
  margin: 0 auto;
}

.nested-angle-button {
  padding: 13px 8px;
  border: 2px solid #d8caef;
  border-radius: 10px;
  color: var(--teal-dark);
  background: #fff;
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(109, 40, 217, 0.08);
  transition:
    transform 140ms cubic-bezier(0.22, 1.4, 0.36, 1),
    border-color 140ms ease,
    background 140ms ease;
}

.nested-angle-button:hover {
  border-color: var(--yellow);
  background: var(--gold-soft);
}

.nested-angle-button:active {
  transform: scale(0.93);
}

.nested-reveal-arrows {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fdfcff;
  text-align: center;
}

.nested-reveal-arrows .nested-arrow-figure {
  --arrow-cell: 26px;
  gap: 4px;
}

.nested-reveal-arrows strong {
  color: var(--teal-dark);
  font-size: 15px;
}

.nested-reveal-arrows.is-win .nested-arrow-figure {
  animation: nested-arrow-pop 620ms cubic-bezier(0.22, 1.6, 0.36, 1) both;
}

@keyframes nested-arrow-pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }

  62% {
    transform: scale(1.09);
    opacity: 1;
  }

  100% {
    transform: scale(1);
  }
}

@media (max-width: 480px) {
  .nested-arrow-figure {
    --arrow-cell: clamp(24px, 7.2vw, 34px);
    gap: 4px;
  }

  .nested-direction-button {
    font-size: 12px;
  }

  .nested-reveal-arrows .nested-arrow-figure {
    --arrow-cell: 21px;
  }
}

@media (max-width: 360px) {
  .nested-direction-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .nested-arrows-stage .nested-arrow-figure,
  .nested-reveal-arrows.is-win .nested-arrow-figure {
    animation: none;
  }

  .nested-direction-button,
  .nested-angle-button {
    transition: none;
  }
}
