/* Shared page atmosphere. It is loaded by the existing return-control stylesheet. */

body:is(
  .xinyu-atmosphere-category,
  .workbench-courseware-entry,
  .workbench-tool-entry,
  .workbench-recording,
  .xinyu-atmosphere-detail,
  .workbench-courseware-detail,
  .xinyu-atmosphere-tool,
  .workbench-tool-detail
) {
  position: relative;
  background-attachment: scroll !important;
}

/* Category pages: approximately 70% of the homepage light field. */
body:is(
  .xinyu-atmosphere-category,
  .workbench-courseware-entry,
  .workbench-tool-entry,
  .workbench-recording
) {
  background:
    radial-gradient(58rem 38rem at 82% -6%, rgba(228, 164, 110, .22), transparent 68%),
    radial-gradient(46rem 34rem at 104% 38%, rgba(120, 160, 140, .17), transparent 70%),
    radial-gradient(40rem 30rem at -8% 12%, rgba(255, 253, 249, .9), transparent 70%),
    linear-gradient(180deg, #faf6ef 0%, var(--xinyu-paper, #f7f1e8) 46%, var(--xinyu-paper-deep, #f1e8dc) 100%) !important;
}

body:is(
  .xinyu-atmosphere-category,
  .workbench-courseware-entry,
  .workbench-tool-entry,
  .workbench-recording
)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .32 !important;
  background-image: radial-gradient(rgba(65, 90, 119, .22) 1px, transparent 1px) !important;
  background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .86) 24%, transparent 78%) !important;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .86) 24%, transparent 78%) !important;
}

/* The shared workbench shell already has a small dot layer; keep one layer. */
body:is(
  .xinyu-atmosphere-category,
  .workbench-courseware-entry,
  .workbench-tool-entry,
  .workbench-recording
).workbench-page::before {
  opacity: 0 !important;
}

body:is(
  .xinyu-atmosphere-category,
  .workbench-courseware-entry,
  .workbench-tool-entry,
  .workbench-recording
) .hero .wrap {
  position: relative;
  isolation: isolate;
}

/* Two quiet echoes of the homepage doodles, kept at the title edges. */
body:is(
  .xinyu-atmosphere-category,
  .workbench-courseware-entry,
  .workbench-tool-entry,
  .workbench-recording
) .hero .wrap::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 26px;
  right: clamp(24px, 4vw, 68px);
  width: 72px;
  height: 72px;
  border: 1.5px solid rgba(68, 117, 93, .28);
  border-radius: 50%;
  pointer-events: none;
}

body:is(
  .xinyu-atmosphere-category,
  .workbench-courseware-entry,
  .workbench-tool-entry,
  .workbench-recording
) .hero .wrap::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: clamp(126px, 16vw, 230px);
  bottom: 24px;
  width: 30px;
  height: 30px;
  opacity: .28;
  pointer-events: none;
  background:
    linear-gradient(rgba(65, 90, 119, .72), rgba(65, 90, 119, .72)) center / 2px 100% no-repeat,
    linear-gradient(90deg, rgba(65, 90, 119, .72), rgba(65, 90, 119, .72)) center / 100% 2px no-repeat;
}

body:is(
  .xinyu-atmosphere-category,
  .workbench-courseware-entry,
  .workbench-tool-entry,
  .workbench-recording
) .hero .wrap > * {
  position: relative;
  z-index: 1;
}

/* Detail page: approximately 40% of the homepage light field. */
body:is(.xinyu-atmosphere-detail, .workbench-courseware-detail) {
  background:
    radial-gradient(58rem 38rem at 82% -6%, rgba(228, 164, 110, .13), transparent 68%),
    radial-gradient(46rem 34rem at 104% 38%, rgba(120, 160, 140, .095), transparent 70%),
    radial-gradient(40rem 30rem at -8% 12%, rgba(255, 253, 249, .92), transparent 70%),
    linear-gradient(180deg, #faf6ef 0%, var(--xinyu-paper, #f7f1e8) 46%, var(--xinyu-paper-deep, #f1e8dc) 100%) !important;
}

body:is(.xinyu-atmosphere-detail, .workbench-courseware-detail)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .22 !important;
  background-image: radial-gradient(rgba(65, 90, 119, .16) .8px, transparent .8px) !important;
  background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .68) 22%, transparent 50%) !important;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .68) 22%, transparent 50%) !important;
}

/* Individual interactive tools: a quiet 15% page shell only. */
body:is(.xinyu-atmosphere-tool, .workbench-tool-detail):not(.classroom-screen) {
  background:
    radial-gradient(58rem 38rem at 82% -6%, rgba(228, 164, 110, .055), transparent 68%),
    radial-gradient(46rem 34rem at 104% 38%, rgba(120, 160, 140, .045), transparent 70%),
    linear-gradient(180deg, #faf6ef 0%, var(--xinyu-paper, #f7f1e8) 52%, var(--xinyu-paper-deep, #f1e8dc) 100%) !important;
  background-attachment: scroll !important;
}

body:is(.xinyu-atmosphere-tool, .workbench-tool-detail):not(.classroom-screen)::before,
body:is(.xinyu-atmosphere-tool, .workbench-tool-detail):not(.classroom-screen)::after {
  content: none !important;
}

body.workbench-tool-detail.warm-operation-v1:not(.classroom-screen),
body.workbench-tool-detail.warm-operation-a2:not(.classroom-screen) {
  background:
    radial-gradient(58rem 38rem at 82% -6%, rgba(228, 164, 110, .055), transparent 68%),
    radial-gradient(46rem 34rem at 104% 38%, rgba(120, 160, 140, .045), transparent 70%),
    linear-gradient(180deg, #faf6ef 0%, var(--xinyu-paper, #f7f1e8) 52%, var(--xinyu-paper-deep, #f1e8dc) 100%) !important;
}

body.workbench-tool-detail.warm-operation-v1:not(.classroom-screen)::before,
body.workbench-tool-detail.warm-operation-v1:not(.classroom-screen)::after,
body.workbench-tool-detail.warm-operation-a2:not(.classroom-screen)::before,
body.workbench-tool-detail.warm-operation-a2:not(.classroom-screen)::after {
  content: none !important;
}

@media (max-width: 640px) {
  body:is(
    .xinyu-atmosphere-category,
    .workbench-courseware-entry,
    .workbench-tool-entry,
    .workbench-recording
  ) {
    background:
      radial-gradient(38rem 26rem at 86% -4%, rgba(228, 164, 110, .14), transparent 70%),
      radial-gradient(32rem 24rem at 108% 30%, rgba(120, 160, 140, .11), transparent 72%),
      radial-gradient(28rem 22rem at -14% 10%, rgba(255, 253, 249, .92), transparent 70%),
      linear-gradient(180deg, #faf6ef 0%, var(--xinyu-paper, #f7f1e8) 48%, var(--xinyu-paper-deep, #f1e8dc) 100%) !important;
  }

  body:is(
    .xinyu-atmosphere-category,
    .workbench-courseware-entry,
    .workbench-tool-entry,
    .workbench-recording
  )::after {
    opacity: .22 !important;
    background-size: 15px 15px;
  }

  body:is(
    .xinyu-atmosphere-category,
    .workbench-courseware-entry,
    .workbench-tool-entry,
    .workbench-recording
  ) .hero .wrap::before,
  body:is(
    .xinyu-atmosphere-category,
    .workbench-courseware-entry,
    .workbench-tool-entry,
    .workbench-recording
  ) .hero .wrap::after {
    display: none;
  }

  body:is(.xinyu-atmosphere-detail, .workbench-courseware-detail) {
    background:
      radial-gradient(38rem 26rem at 86% -4%, rgba(228, 164, 110, .075), transparent 70%),
      radial-gradient(32rem 24rem at 108% 30%, rgba(120, 160, 140, .055), transparent 72%),
      radial-gradient(28rem 22rem at -14% 10%, rgba(255, 253, 249, .94), transparent 70%),
      linear-gradient(180deg, #faf6ef 0%, var(--xinyu-paper, #f7f1e8) 48%, var(--xinyu-paper-deep, #f1e8dc) 100%) !important;
  }

  body:is(.xinyu-atmosphere-detail, .workbench-courseware-detail)::after {
    opacity: .13 !important;
    background-size: 15px 15px;
  }

  body:is(.xinyu-atmosphere-tool, .workbench-tool-detail):not(.classroom-screen) {
    background:
      radial-gradient(38rem 26rem at 86% -4%, rgba(228, 164, 110, .035), transparent 70%),
      radial-gradient(32rem 24rem at 108% 30%, rgba(120, 160, 140, .028), transparent 72%),
      linear-gradient(180deg, #faf6ef 0%, var(--xinyu-paper, #f7f1e8) 52%, var(--xinyu-paper-deep, #f1e8dc) 100%) !important;
  }
}
