:root {
  --ad-height: 90px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0f1218;
  color: #e8ecf3;
}

.layout {
  position: relative;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

.embed-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: #11151d;
}

/* 有广告时给内嵌区留出底部空间 */
body.has-ad .embed-wrap {
  height: calc(100% - var(--ad-height));
  height: calc(100dvh - var(--ad-height));
  padding-bottom: 0;
}

.embed-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

.embed-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 18, 24, 0.72);
  font-size: 14px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* 固定在视口底部，严格限制高度，防止大图撑满全屏 */
.ad-slot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 1000;
  width: 100%;
  height: var(--ad-height);
  max-height: var(--ad-height);
  min-height: 0;
  margin: 0;
  padding: 0;
  background: #161b25;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.ad-slot a {
  display: block;
  width: 100%;
  height: 100%;
  max-height: var(--ad-height);
  overflow: hidden;
  line-height: 0;
}

.ad-slot img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: var(--ad-height);
  object-fit: fill;
  object-position: center;
  border: 0;
  background: #10141c;
}

.ad-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.ad-close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  :root {
    --ad-height: 72px;
  }
}
