.home-announcement {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px 18px;
  margin-top: 24px;
  margin-bottom: 18px;
  padding: 17px 20px;
  border: 1px solid #c8d9fc;
  border-radius: 10px;
  background: #f1f6ff;
  color: #0f172a;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.home-announcement__title {
  color: #1745a4;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.home-announcement__content {
  min-width: 0;
  margin: 0;
  color: #34445f;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.site-announcement {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #dbe5f0;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 16px 36px rgb(15 23 42 / 18%);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.site-announcement::backdrop { background: rgb(15 23 42 / 58%); }
body:has(.site-announcement[open]) { overflow: hidden; }

.site-announcement__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 12px;
  background: #fff;
}

.site-announcement__header h2 {
  min-width: 0;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
}

.site-announcement__close {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
}
.site-announcement__close:hover { background: #eff6ff; color: #1d4ed8; }

.site-announcement__body { padding: 0 24px 20px; }
.site-announcement__content {
  max-width: 70ch;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: #334155;
  font-size: 16px;
  line-height: 1.7;
}
.site-announcement__qr { margin: 20px 0 0; text-align: center; }
.site-announcement__qr[hidden] { display: none; }
.site-announcement__qr img {
  display: block;
  width: 180px;
  height: 180px;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.site-announcement__footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px 24px;
  border-top: 1px solid #e2e8f0;
}
.site-announcement__ack {
  min-width: 100px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #2563eb;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.site-announcement__ack:hover { background: #1d4ed8; }
.site-announcement :is(button):focus-visible { outline: 3px solid rgb(37 99 235 / 35%); outline-offset: 2px; }

@media (max-width: 420px) {
  .home-announcement { grid-template-columns: 1fr; gap: 4px; margin-top: 16px; margin-bottom: 14px; padding: 14px 15px; }
  .site-announcement { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .site-announcement__header { padding: 18px 18px 10px; }
  .site-announcement__header h2 { font-size: 20px; }
  .site-announcement__body { padding: 0 18px 18px; }
  .site-announcement__qr img { width: 160px; height: 160px; }
  .site-announcement__footer { padding: 14px 18px 18px; }
  .site-announcement__ack { width: 100%; }
}
