/* 首页公告弹窗 · 对齐目标站 home-popup-v12（白色卡片 / 顶部横幅 / 富文本 / 全宽主按钮）
   主按钮走南宫紫粉；弹窗始终为浅底，不受站点深色模式影响。 */

/* 用 id 选择器提升优先级，压过 ng-ui.css 的 `body.ng-skin > * { position:relative; z-index:1 }` */
#ngHomePopup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
#ngHomePopup[hidden] { display: none; }

.ng-hp__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 48, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
#ngHomePopup.is-open .ng-hp__backdrop { opacity: 1; }

.ng-hp__card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(88dvh, 780px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.38);
  opacity: 0;
  transform: translateY(6px) scale(0.985);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#ngHomePopup.is-open .ng-hp__card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 右上角关闭按钮 */
.ng-hp__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #334155;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.ng-hp__close:hover { transform: scale(1.06); background: #ffffff; }
.ng-hp__close svg { display: block; fill: currentColor; }

/* 顶部横幅图 */
.ng-hp__media {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1280 / 548;
  max-height: 40dvh;
  background: #f4f6ff;
  overflow: hidden;
}
.ng-hp__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 有横幅图时关闭按钮压在图上，用深色描边圆底更清晰 */
.ng-hp__media ~ .ng-hp__close,
.ng-hp__card:has(.ng-hp__media) .ng-hp__close {
  background: rgba(20, 28, 48, 0.32);
  color: #ffffff;
  box-shadow: none;
}

/* 正文区 */
.ng-hp__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ng-hp__body-inner {
  padding: 26px 30px 28px;
  display: flex;
  flex-direction: column;
}
.ng-hp__title {
  margin: 0 0 14px;
  text-align: center;
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 800;
  line-height: 1.3;
  color: #17233a;
  letter-spacing: 0.01em;
}
.ng-hp__content {
  font-size: 16px;
  line-height: 1.8;
  color: #17233a;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 长文折叠：PC 5 行、移动 3 行 */
.ng-hp__content.is-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
}
.ng-hp__rich-link {
  color: #1559d6;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.ng-hp__rich-red { color: #c62828; font-weight: 600; }

/* 展开/收起 */
.ng-hp__more {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.ng-hp__more-btn {
  border: 0;
  background: transparent;
  color: #6a3fb0;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
}
.ng-hp__more-btn:hover { text-decoration: underline; }

/* 全宽主按钮（南宫紫粉） */
.ng-hp__action {
  margin-top: 22px;
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #9a6fe0 0%, #7c4cc9 45%, #6a3fb0 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(122, 74, 196, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.ng-hp__action:hover { filter: brightness(1.05); transform: translateY(-1px); }
.ng-hp__action:active { transform: translateY(0); }

/* 打开弹窗时锁定背景滚动 */
body.ng-hp-open { overflow: hidden; }

/* 移动端 */
@media (max-width: 560px), (max-height: 560px) {
  .ng-hp { padding: 14px; }
  .ng-hp__card { border-radius: 20px; max-height: 86dvh; }
  .ng-hp__media { max-height: 36dvh; }
  .ng-hp__body-inner { padding: 22px 20px 22px; }
  .ng-hp__content { font-size: 14px; line-height: 1.75; }
  .ng-hp__content.is-collapsed { -webkit-line-clamp: 3; line-clamp: 3; }
  .ng-hp__action { min-height: 48px; font-size: 15px; margin-top: 18px; }
  .ng-hp__close { top: 10px; right: 10px; width: 36px; height: 36px; }
}
