:root {
  --public-event-banner-h: 36px;
}

.public-event-banner {
  position: relative;
  z-index: 110;
  width: 100%;
  height: var(--public-event-banner-h);
  overflow: hidden;
  color: #f3f8ef;
  background:
    linear-gradient(90deg, rgba(255,255,255,.045), transparent 28%, rgba(255,255,255,.035) 70%, transparent),
    #244b25;
  border-top: 1px solid #4f7d46;
  border-bottom: 2px solid #142f17;
  box-shadow: inset 0 1px rgba(255,255,255,.08), inset 0 -1px rgba(0,0,0,.18);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  cursor: pointer;
}

.public-event-banner__inner {
  width: min(1380px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  position: relative;
  box-sizing: border-box;
  padding: 0 clamp(190px, 18vw, 285px);
  font-size: 12px;
  line-height: 1;
  color: inherit;
  text-decoration: none;
}

.public-event-banner__inner::after {
  content: "→";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-52%);
  color: #fff2a8;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  transition: transform .16s ease, color .16s ease;
}

.public-event-banner:hover .public-event-banner__inner::after,
.public-event-banner__inner:focus-visible::after {
  transform: translate(4px, -52%);
  color: #fff;
}

.public-event-banner__inner:focus-visible {
  outline: 2px solid #fff2a8;
  outline-offset: -2px;
}

.public-event-banner__badge {
  flex: none;
  padding: 4px 7px 3px;
  color: #183115;
  background: #9bd66f;
  border: 1px solid #c3eca4;
  box-shadow: 2px 2px 0 #102a13;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.public-event-banner strong {
  flex: none;
  color: #fff2a8;
  font-size: 12px;
  font-weight: 750;
}

.public-event-banner__detail {
  min-width: 0;
  overflow: hidden;
  color: #d5e5d0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-event-banner__group {
  flex: none;
  position: absolute;
  right: 30px;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

/* 简洁模式本身锁定为一屏，活动条出现后需要把内容区相应缩短。 */
.public-event-banner + .login-view,
.public-event-banner ~ .login-view {
  min-height: calc(100vh - var(--public-event-banner-h));
  min-height: calc(100dvh - var(--public-event-banner-h));
}

.public-event-banner + .shell,
.public-event-banner ~ .shell {
  height: calc(100vh - var(--public-event-banner-h));
  height: calc(100dvh - var(--public-event-banner-h));
}

/* 预览模式左栏原本按整屏计算，扣掉活动条后不会在底部多出滚动。 */
.public-event-banner ~ .hud .chat-panel,
.public-event-banner ~ .hud .chat-box {
  max-height: calc(100vh - var(--titlebar-h, 60px) - var(--public-event-banner-h) - 36px);
  max-height: calc(100dvh - var(--titlebar-h, 60px) - var(--public-event-banner-h) - 36px);
}

@media (max-width: 680px) {
  :root { --public-event-banner-h: 34px; }

  .public-event-banner__inner {
    width: calc(100% - 20px);
    gap: 7px;
    padding: 0 24px 0 0;
  }

  .public-event-banner__detail { display: none; }
  .public-event-banner strong {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .public-event-banner__group { position: static; margin-left: 0; font-size: 11px; }
}

@media (max-width: 420px) {
  .public-event-banner__badge { padding-inline: 5px; letter-spacing: 0; }
  .public-event-banner strong { font-size: 11px; }
  .public-event-banner__group { font-size: 0; }
  .public-event-banner__group::after { content: "QQ群 1087024879"; font-size: 10px; }
}
