/* ============================================================
   首页顶部「重要公告」横幅
   —— 黄底黑字，重点词蓝色；可关闭，可勾选「始终在上」吸顶
   ============================================================ */
.notice-bar {
  position: relative;
  z-index: 940;
  margin-top: var(--nav-h, 64px);
  background: #ffd60a;
  color: #0a0f0c;
  border-bottom: 1px solid rgba(10, 20, 15, 0.16);
  color-scheme: light; /* 深色主题下让复选框等原生控件保持浅色 */
  box-shadow: 0 10px 30px -26px rgba(0, 0, 0, 0.55);
  font-family: var(--sans, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif);
}
.notice-bar[hidden] { display: none !important; }

/* 勾选「始终在上」后吸顶在导航下方 */
.notice-bar.is-pinned {
  position: sticky;
  top: var(--nav-h, 64px);
}

.nb-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.62rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nb-tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.58rem;
  border-radius: 6px;
  background: #0b100d;
  color: #ffd60a;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1;
  white-space: nowrap;
}
.nb-tag svg { width: 0.86em; height: 0.86em; flex: none; }

.nb-text {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.6;
  color: #0b100d;
  word-break: break-word;
}
.nb-text b.nb-hl {
  color: #1553d6;
  font-weight: 800;
}

.nb-pin {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  color: rgba(11, 16, 13, 0.7);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nb-pin:hover { background: rgba(11, 16, 13, 0.07); color: #0b100d; }
.nb-pin input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #1553d6;
  cursor: pointer;
}

.nb-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(11, 16, 13, 0.22);
  border-radius: 50%;
  background: transparent;
  color: rgba(11, 16, 13, 0.7);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.nb-close:hover { background: #0b100d; border-color: #0b100d; color: #ffd60a; }

/* 深色主题下仍然是黄底黑字（公告条不跟随主题变暗） */
body:not(.light) .notice-bar {
  background: #ffd60a;
  color: #0a0f0c;
  border-bottom-color: rgba(0, 0, 0, 0.28);
}

@media (max-width: 860px) {
  .nb-inner { padding: 0.58rem 1rem; gap: 0.6rem; }
  .nb-text { font-size: 0.82rem; }
}

@media (max-width: 720px) {
  .nb-inner { flex-wrap: wrap; padding: 0.6rem 1rem; }
  .nb-text { order: 3; flex-basis: 100%; }
  .nb-pin { margin-left: auto; }
  .nb-close { order: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .notice-bar, .nb-pin, .nb-close { transition: none; }
}
