/*
 * 智链导航（SmartLink Nav）
 *
 * @copyright 蓝河豚  www.t128.com
 * @license   保留所有权利
 * @link      https://www.t128.com
 */
/* ============================================================
 * v3.0.1 顶部可配置通知条（.sln-topbar）
 *
 * 设计要点：
 *   · 细条（38px），整页全宽，独立于 .container，不和首页
 *     「付费置顶推荐」大图位争抢首屏空间。
 *   · 每条公告自带背景色（行内 style），文字颜色由 PHP 按
 *     底色亮度算出白 / 近黑，保证对比度；CSS 只兜底。
 *   · 多条时纵向无缝滚动（与既有 .flash-roll 同款双份渲染），
 *     单条时静止；手机端文字单行省略，不溢出。
 *   · 右侧关闭按钮：点按后按内容指纹静默，改了内容自动复现。
 * ============================================================ */

.sln-topbar {
  position: relative;
  width: 100%;
  /* 底色兜底：第一条公告出现前 / 无 JS 时的瞬间，用主题色不跳色 */
  background: var(--theme, #2563eb);
  font-size: 13px;
  line-height: 1.4;
}

.sln-topbar-roll {
  height: 38px;
  overflow: hidden;
  position: relative;
}

.sln-topbar-roll ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  animation: slnTopbarRoll var(--sln-dur, 12s) linear infinite;
  will-change: transform;
}

/* 单条公告：不滚动，静态居中 */
.sln-topbar.is-static .sln-topbar-roll ul { animation: none; }

.sln-topbar-roll li {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 右侧预留关闭按钮空间；左右留白避免贴边 */
  padding: 0 40px;
  box-sizing: border-box;
}

.sln-topbar-roll li a,
.sln-topbar-roll li .sln-tb-text {
  /* 颜色由行内 style 决定；这里只约束排版，杜绝横向溢出 */
  color: inherit;
  text-decoration: none;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sln-topbar-roll li a:hover { text-decoration: underline; opacity: .92; }

.sln-topbar-ico {
  flex-shrink: 0;
  margin-right: 6px;
  opacity: .9;
}

.sln-topbar-close {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  color: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sln-topbar-close:hover { background: rgba(255, 255, 255, .38); }

@keyframes slnTopbarRoll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .sln-topbar-roll ul { animation: none; }
}

@media (max-width: 640px) {
  .sln-topbar { font-size: 12.5px; }
  .sln-topbar-roll,
  .sln-topbar-roll li { height: 36px; }
  .sln-topbar-roll li { padding: 0 34px; }
}
