/* ==========================================================================
   广告宇宙层（AdWorld） / 可关闭广告壳（AdShell）
   这不是高级 UI。这是被广告联盟收购的 UI。
   ========================================================================== */

:root {
  --adx-yellow: #ffe84a;
  --adx-pink: #ff2ea6;
  --adx-cyan: #65f9ff;
  --adx-lime: #c8ff37;
  --adx-cream: #f4e7ca;
  --adx-red: #c51b2e;
  --adx-ink: #0b0312;
  --adx-panel: #1b0a23;
  --adx-font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --adx-serif: "SimSun", "Songti SC", "STSong", serif;
  --adx-mono: "Lucida Console", Consolas, "Courier New", monospace;
}

/* --------------------------------------------------------------------------
   AdShell：全屏可关闭广告体验
   -------------------------------------------------------------------------- */

.adx-overlay {
  position: fixed;
  inset: 0;
  z-index: 860;
  display: flex;
  overflow: hidden;
  color: var(--adx-cream);
  background:
    radial-gradient(ellipse at 78% 12%, rgba(255, 46, 166, .16), transparent 42%),
    radial-gradient(ellipse at 12% 88%, rgba(101, 249, 255, .1), transparent 45%),
    #07010c;
  font-family: var(--adx-font);
  animation: adx-overlay-in .28s ease-out both;
}

.adx-overlay-noise {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .36;
  background:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, .34) 2px 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 5px);
  mix-blend-mode: multiply;
}

.adx-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, .52));
}

.adx-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: transparent;
}

.adx-shellbar {
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 43px;
  min-height: 43px;
  padding: 0 7px 0 14px;
  color: #b9aabf;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 45%),
    #150a1c;
  border-bottom: 2px solid #3e1c47;
  box-shadow: inset 0 -1px 0 #06010a;
  font-family: var(--adx-mono);
  font-size: 8px;
  letter-spacing: .02em;
}

.adx-shellbrand {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--adx-pink);
  white-space: nowrap;
}

.adx-shellbrand i {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  color: #1d0700;
  background: var(--adx-yellow);
  font-style: normal;
  font-size: 10px;
  box-shadow: 1px 1px 0 #000;
}

.adx-shellbrand b {
  overflow: hidden;
  font-family: var(--adx-font);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-overflow: ellipsis;
}

.adx-shell-note {
  margin-left: auto;
  overflow: hidden;
  color: #6e5a76;
  font-family: var(--adx-serif);
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.adx-close {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: none;
  min-width: 64px;
  height: 30px;
  margin-left: 4px;
  padding: 0 6px;
  border: 1px solid #785682;
  color: #f1dfd1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 45%),
    #2b1330;
  box-shadow: 2px 2px 0 #050107;
  font-family: var(--adx-font);
  font-size: 8px;
  cursor: pointer;
}

.adx-close span {
  color: var(--adx-yellow);
  font-family: var(--adx-mono);
  font-size: 20px;
  line-height: 1;
}

.adx-close small {
  font-size: 7px;
  line-height: 1.1;
  text-align: left;
}

.adx-close:hover {
  color: #1d050c;
  background: var(--adx-yellow);
  border-color: #000;
}

.adx-close:hover span,
.adx-close:hover small {
  color: #1d050c;
}

.adx-stage {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #7f5b8b #1b0a23;
  scrollbar-width: thin;
}

.adx-stage::-webkit-scrollbar { width: 9px; }
.adx-stage::-webkit-scrollbar-track { background: #1b0a23; }
.adx-stage::-webkit-scrollbar-thumb { background: #7f5b8b; border: 2px solid #1b0a23; }

.adx-overlay.adx-closing {
  animation: adx-overlay-out .26s ease-in both;
}

body.adx-overlay-open {
  overflow: hidden !important;
}

@keyframes adx-overlay-in {
  from { opacity: 0; transform: scale(1.012); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes adx-overlay-out {
  to { opacity: 0; transform: scale(1.014); visibility: hidden; }
}

/* --------------------------------------------------------------------------
   AdWorld toasts / 成就 / 抗议 / 状态
   -------------------------------------------------------------------------- */

.adx-toast-root {
  position: fixed;
  right: 16px;
  bottom: 17px;
  z-index: 970;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: min(370px, calc(100vw - 28px));
  pointer-events: none;
  font-family: var(--adx-font);
}

.adx-toast {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr 16px;
  gap: 0 7px;
  align-items: start;
  width: fit-content;
  max-width: 100%;
  padding: 7px 18px 7px 8px;
  color: #2b0916;
  background:
    repeating-linear-gradient(0deg, rgba(116, 42, 18, .04) 0 1px, transparent 1px 4px),
    #f7eacb;
  border: 2px solid #21050c;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .48);
  font-size: 9px;
  line-height: 1.45;
  pointer-events: auto;
  animation: adx-toast-in .24s ease-out both;
}

.adx-toast::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -2px;
  bottom: 2px;
  width: 3px;
  background: var(--adx-pink);
}

.adx-toast b {
  color: #a21839;
  font-family: var(--adx-mono);
  font-size: 7px;
  letter-spacing: .02em;
  white-space: nowrap;
}

.adx-toast span {
  color: #4b2d22;
  font-family: var(--adx-serif);
  overflow-wrap: anywhere;
}

.adx-toast button {
  position: absolute;
  right: 2px;
  top: 1px;
  color: #79533b;
  font-family: var(--adx-mono);
  font-size: 12px;
  line-height: 1;
}

.adx-toast button:hover { color: var(--adx-red); }

.adx-toast--danger {
  background: #ffb9c8;
  border-color: #65091e;
}

.adx-toast--danger b { color: #a50624; }

.adx-toast--win {
  color: #1e2603;
  background: #e1ffb1;
  border-color: #264201;
}

.adx-toast--win b { color: #4b7300; }

.adx-toast--whisper {
  color: #d7c8e0;
  background: #24112d;
  border-color: #8f5aa1;
}

.adx-toast--whisper span { color: #c7afd2; }
.adx-toast--whisper button { color: #b992c7; }

.adx-toast--system {
  color: #d9fff5;
  background: #0d2d29;
  border-color: #66cbb8;
}

.adx-toast--system span { color: #b4ede2; }

.adx-toast.is-leaving {
  animation: adx-toast-out .24s ease-in both;
}

@keyframes adx-toast-in {
  from { opacity: 0; transform: translateX(22px) rotate(1deg); }
  to { opacity: 1; transform: translateX(0) rotate(0); }
}

@keyframes adx-toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

.adx-achievement-root {
  position: fixed;
  left: 50%;
  top: 18px;
  z-index: 975;
  display: flex;
  justify-content: center;
  width: min(520px, calc(100vw - 28px));
  transform: translateX(-50%);
  pointer-events: none;
  font-family: var(--adx-font);
}

.adx-achievement {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 30px 9px 10px;
  color: #2d1704;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .16) 0 7px, transparent 7px 14px),
    linear-gradient(100deg, #ffe573, #ffbd34);
  border: 3px solid #2a1005;
  box-shadow: 5px 6px 0 rgba(0, 0, 0, .43), 0 0 26px rgba(255, 205, 52, .35);
  pointer-events: auto;
  animation: adx-achievement-in .35s cubic-bezier(.18, .9, .2, 1.1) both;
}

.adx-achievement-medal {
  display: grid;
  place-items: center;
  flex: none;
  width: 45px;
  height: 45px;
  border: 2px solid #2a1005;
  border-radius: 50%;
  color: #532504;
  background: #fff4c2;
  font-size: 23px;
  text-shadow: 1px 1px 0 #fff;
  animation: adx-medal-spin 5s linear infinite;
}

.adx-achievement-copy {
  min-width: 0;
}

.adx-achievement-copy > span {
  display: block;
  color: #7b3d0f;
  font-family: var(--adx-mono);
  font-size: 7px;
  letter-spacing: .04em;
}

.adx-achievement-copy b {
  display: block;
  font-family: var(--adx-serif);
  font-size: 17px;
  line-height: 1.2;
}

.adx-achievement-copy p {
  margin: 2px 0;
  color: #633917;
  font-family: var(--adx-serif);
  font-size: 9px;
  line-height: 1.4;
}

.adx-achievement-copy small {
  display: block;
  color: #9d6c37;
  font-family: var(--adx-serif);
  font-size: 7px;
}

.adx-achievement button {
  position: absolute;
  right: 5px;
  top: 3px;
  color: #6f4516;
  font-size: 14px;
  font-family: var(--adx-mono);
}

.adx-achievement button:hover { color: #9e101c; }

.adx-achievement.is-leaving {
  animation: adx-achievement-out .26s ease-in both;
}

@keyframes adx-achievement-in {
  from { opacity: 0; transform: translateY(-22px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes adx-achievement-out {
  to { opacity: 0; transform: translateY(-18px) scale(.97); }
}

@keyframes adx-medal-spin {
  to { transform: rotate(360deg); }
}

.adx-protest-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 48px;
  z-index: 850;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 12px;
  overflow: hidden;
  color: #f5e8d0;
  background: #17050b;
  border-top: 2px solid #b51f2f;
  border-bottom: 2px solid #b51f2f;
  box-shadow: 0 -4px 18px rgba(181, 31, 47, .24);
  font-family: var(--adx-serif);
  font-size: 8px;
  animation: adx-protest-in .25s ease-out both;
}

.adx-protest-banner.is-leaving { animation: adx-protest-out .35s ease-in both; }

.adx-protest-tag {
  flex: none;
  padding: 2px 5px;
  color: #fff2d9;
  background: #b51f2f;
  font-family: var(--adx-mono);
  font-size: 7px;
  font-weight: 900;
}

.adx-protest-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #e4b4b8;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.adx-protest-banner button {
  flex: none;
  color: #e9b4b6;
  font-size: 13px;
}

.adx-protest-banner button:hover { color: var(--adx-yellow); }

.adx-world-status {
  color: #9b8197 !important;
  font-family: var(--adx-mono) !important;
  font-size: 7px !important;
}

.adx-world-status b {
  color: var(--adx-yellow) !important;
}

body.adx-network-danger .adx-world-status b {
  color: #ff6b6b !important;
}

body.adx-mourning .adx-world-status {
  color: #e1aab2 !important;
}

body.adx-level-up .crt-overlay {
  animation: adx-crt-alert .5s steps(2) 1;
}

@keyframes adx-protest-in {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes adx-protest-out {
  to { transform: translateY(18px); opacity: 0; }
}

@keyframes adx-crt-alert {
  0%, 100% { opacity: .8; }
  20% { opacity: .35; }
  40% { opacity: 1; }
  60% { opacity: .4; }
}

/* --------------------------------------------------------------------------
   广告位破产 / 已关闭
   -------------------------------------------------------------------------- */

.ad.adx-destroyed,
.ad.adx-closed-ad {
  filter: saturate(.42) brightness(.84);
}

.ad.adx-destroyed > *:not(.adx-vacancy),
.ad.adx-closed-ad > *:not(.adx-vacancy) {
  visibility: hidden !important;
}

.adx-vacancy {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 13px;
  color: #d7c9bf;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 5px),
    radial-gradient(ellipse at 50% 0, rgba(255, 46, 166, .12), transparent 60%),
    #0f0811;
  border: 2px solid #4d2e4d;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, .55);
  font-family: var(--adx-font);
  text-align: center;
  pointer-events: none;
}

.adx-vacancy::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(212, 163, 181, .35);
  pointer-events: none;
}

.adx-vacancy-badge {
  padding: 2px 6px;
  color: #22050b;
  background: var(--adx-yellow);
  font-family: var(--adx-mono);
  font-size: 7px;
  font-weight: 900;
  transform: rotate(-2deg);
}

.adx-vacancy b {
  color: #ffebc0;
  font-family: var(--adx-serif);
  font-size: clamp(13px, 1.25vw, 17px);
  line-height: 1.25;
}

.adx-vacancy p {
  margin: 0;
  color: #bda5a5;
  font-family: var(--adx-serif);
  font-size: 8px;
  line-height: 1.5;
}

.adx-vacancy small {
  color: #8b6575;
  font-family: var(--adx-serif);
  font-size: 7px;
  line-height: 1.4;
}

.adx-vacancy--closed {
  background: #0b0810;
  border-color: #473b44;
}

.adx-vacancy--closed .adx-vacancy-badge {
  color: #f1e5ce;
  background: #714454;
}

.adx-mourning-ribbon {
  position: absolute;
  left: 5px;
  bottom: 5px;
  z-index: 55;
  max-width: calc(100% - 10px);
  padding: 2px 5px;
  overflow: hidden;
  color: #ead8dd;
  background: rgba(12, 3, 9, .92);
  border-left: 2px solid #c02436;
  font-family: var(--adx-serif);
  font-size: 6px;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
  transform: rotate(-1deg);
}

/* --------------------------------------------------------------------------
   可互动广告的提示（不喧宾夺主）
   -------------------------------------------------------------------------- */

.ad.adx-interactive {
  outline: 1px dashed rgba(101, 249, 255, .25);
  outline-offset: 3px;
}

.ad.adx-interactive .ad-cta::after {
  content: " ●";
  color: #fff;
  font-size: .72em;
  text-shadow: 0 0 7px rgba(255, 255, 255, .9);
  animation: adx-interactive-dot 1.3s ease-in-out infinite;
}

@keyframes adx-interactive-dot {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 800px) {
  .adx-shellbar {
    flex: 0 0 48px;
    min-height: 48px;
    padding: 0 5px 0 8px;
  }

  .adx-shellbrand b {
    max-width: 48vw;
    font-size: 8px;
  }

  .adx-shell-note {
    display: none;
  }

  .adx-close {
    min-width: 54px;
    height: 44px;
    margin-left: auto;
    padding: 0 4px;
  }

  .adx-close span { font-size: 22px; }
  .adx-close small { display: none; }

  .adx-toast-root {
    top: 53px;
    right: 8px;
    bottom: auto;
    left: 8px;
    width: auto;
    align-items: stretch;
  }

  .adx-toast {
    width: 100%;
    max-width: none;
    font-size: 9px;
  }

  .adx-achievement-root {
    top: 53px;
    width: calc(100vw - 16px);
  }

  .adx-achievement {
    padding: 7px 26px 7px 7px;
  }

  .adx-achievement-medal {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .adx-achievement-copy b { font-size: 14px; }
  .adx-achievement-copy p { font-size: 8px; }
  .adx-achievement-copy small { font-size: 6px; }

  .adx-protest-banner {
    bottom: 0;
    min-height: 34px;
    padding: 0 8px;
    font-size: 7px;
  }

  .adx-world-status {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   温和模式：广告仍然垃圾，但闪得礼貌一点
   -------------------------------------------------------------------------- */

body.mild .adx-overlay,
body.mild .adx-toast,
body.mild .adx-achievement,
body.mild .adx-protest-banner,
body.mild .adx-achievement-medal,
body.mild .adx-interactive .ad-cta::after {
  animation: none !important;
}

body.mild .adx-overlay-noise {
  opacity: .16;
}
