/* ==========================================================================
   滚动公告 —— 前台样式
   ========================================================================== */

#lx-notice.lx-nt,
#lx-notice-preview.lx-nt {
  --lx-nt-accent: #4f46e5;
  --lx-nt-dur: 28s;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  margin: 0 0 14px;
  padding: 0 8px 0 0;
  box-sizing: border-box;
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.07);
  overflow: hidden;
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
  color: #33333d;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#lx-notice.lx-nt *,
#lx-notice-preview.lx-nt * { box-sizing: border-box; }

/* 夜间模式（模板 html.night-mode） */
html.night-mode #lx-notice.lx-nt,
html.night-mode #lx-notice-preview.lx-nt {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e6e6ee;
}

/* ---------- 左侧标签 ---------- */
.lx-nt-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: stretch;
  padding: 0 12px;
  border-radius: 9px 0 0 9px;
  background: var(--lx-nt-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.lx-nt-badge em { font-style: normal; }
.lx-nt-badge svg { flex: none; }

/* ---------- 滚动视口 ---------- */
.lx-nt-view {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.lx-nt-track {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
}
.lx-nt-scroll .lx-nt-track {
  animation: lx-nt-marquee var(--lx-nt-dur) linear infinite;
}
/* 鼠标悬停暂停，方便阅读 / 点击 */
#lx-notice.lx-nt:hover .lx-nt-track,
#lx-notice-preview.lx-nt:hover .lx-nt-track { animation-play-state: paused; }

@keyframes lx-nt-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.lx-nt-group {
  display: flex;
  align-items: center;
  flex: none;
}

.lx-nt-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
a.lx-nt-item:hover,
a.lx-nt-item:focus {
  color: var(--lx-nt-accent);
  text-decoration: underline;
  outline: none;
}

.lx-nt-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lx-nt-accent);
}
.lv-primary .lx-nt-dot { background: #e5484d; }
.lv-success .lx-nt-dot { background: #30a46c; }
.lv-warning .lx-nt-dot { background: #f5a524; }
.lv-danger  .lx-nt-dot { background: #e5484d; box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.18); }

.lx-nt-sep {
  flex: none;
  width: 1px;
  height: 12px;
  margin: 0 12px;
  background: currentColor;
  opacity: 0.22;
}

/* ---------- 静止模式 ---------- */
.lx-nt-static .lx-nt-track { animation: none; }
.lx-nt-static .lx-nt-view { white-space: nowrap; text-overflow: ellipsis; }
.lx-nt-static .lx-nt-item { max-width: 100%; }
.lx-nt-static .lx-nt-item span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- 关闭按钮 ---------- */
.lx-nt-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.16s, background 0.16s;
}
.lx-nt-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.07);
}
html.night-mode .lx-nt-close:hover { background: rgba(255, 255, 255, 0.12); }

/* 关闭时淡出 */
.lx-nt-hiding {
  opacity: 0 !important;
  transform: translateY(-6px);
}

/* ---------- 后台预览 ---------- */
#lx-notice-preview.lx-nt {
  margin: 0;
  background: rgba(79, 70, 229, 0.06);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  #lx-notice.lx-nt,
  #lx-notice-preview.lx-nt {
    height: 36px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: 12px;
    gap: 8px;
  }
  .lx-nt-badge { padding: 0 9px; font-size: 11px; border-radius: 7px 0 0 7px; }
  .lx-nt-badge em { display: none; }   /* 小屏只留喇叭图标 */
  .lx-nt-sep { margin: 0 8px; }
  .lx-nt-close { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .lx-nt-scroll .lx-nt-track { animation: none; }
  #lx-notice.lx-nt { transition: none; }
}

@media print {
  #lx-notice.lx-nt { display: none !important; }
}
