/* =========================================================
   AI 资讯悬浮卡（首页左下角 · 像广告位那样的小挂件）
   轮询播放最新 AI 热点，可暂停 / 可关闭 / 可重新唤出。
   全部颜色走站点 CSS 变量，深浅色与背景图主题自动跟随。
   ========================================================= */

.an-news {
  position: fixed;
  left: 18px; bottom: 18px;
  width: 336px; max-width: calc(100vw - 36px);
  z-index: 62;
  border-radius: 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .16), 0 2px 8px rgba(0, 0, 0, .06);
  overflow: hidden;
  animation: anIn .46s cubic-bezier(.16, 1, .3, 1) both;
  transition: transform .3s var(--ease-out), opacity .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.an-news:hover { transform: translateY(-3px); box-shadow: 0 22px 54px rgba(0, 0, 0, .2); }
.an-news[hidden] { display: none; }
@keyframes anIn {
  from { opacity: 0; transform: translateX(-26px) translateY(14px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* ---- 顶栏 ---- */
.an-news__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(120deg, var(--brand), var(--accent, #00AEEC));
  color: #fff;
}
.an-news__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 0 rgba(255, 255, 255, .8);
  animation: anPulse 1.8s infinite;
  flex: 0 0 auto;
}
@keyframes anPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); }
  70%  { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.an-news.is-paused .an-news__dot { animation: none; opacity: .5; }
.an-news__title { font-size: 13.5px; font-weight: 800; letter-spacing: .3px; }
.an-news__live {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .22); color: #fff; flex: 0 0 auto;
}
.an-news__acts { margin-left: auto; display: flex; gap: 2px; }
.an-news__act {
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 0; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 12px; font-family: inherit; line-height: 1;
  transition: background .18s, transform .18s;
}
.an-news__act:hover { background: rgba(255, 255, 255, .34); transform: translateY(-1px); }
.an-news__act svg { width: 13px; height: 13px; }

/* ---- 内容区 ---- */
.an-news__body { padding: 12px 14px 10px; }
.an-news__src {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  margin-bottom: 8px;
}
/* 英文权威源条目右上角的小标，提示这条是英文原文 */
.an-news__lang {
  font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .4px;
  padding: 1px 4px; border-radius: 4px;
  background: rgba(124, 92, 255, .16); color: #7C5CFF;
}
/* 已译成中文的英文条目：换青色，跟「未翻译」区分开 */
.an-news__lang.is-zh {
  background: rgba(0, 231, 199, .16); color: #00A78E;
}
.an-news__headline {
  display: block; margin: 0 0 6px;
  font-size: 14.5px; font-weight: 700; line-height: 1.5; color: var(--text);
  text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.an-news__headline:hover { color: var(--brand); }
.an-news__desc {
  margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.an-news__foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; font-size: 11.5px; color: var(--text-3);
}
.an-news__time { display: inline-flex; align-items: center; gap: 4px; }
.an-news__nav { margin-left: auto; display: flex; gap: 6px; }
.an-news__nav button {
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  width: 24px; height: 24px; border-radius: 7px; cursor: pointer;
  font-size: 11px; line-height: 1; display: grid; place-items: center;
  transition: all .18s;
}
.an-news__nav button:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---- 轮播进度条 + 圆点 ---- */
.an-news__progress { height: 2.5px; background: var(--line-2, var(--line)); overflow: hidden; }
.an-news__progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--accent, #00AEEC));
  transition: width .2s linear;
}
.an-news.is-paused .an-news__progress i { opacity: .35; }
.an-news__dots { display: flex; justify-content: center; gap: 4px; padding: 8px 0 9px; }
.an-news__dots b {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--line); transition: all .25s;
}
.an-news__dots b.on { background: var(--brand); width: 14px; border-radius: 3px; }

/* ---- 加载 / 失败态 ---- */
.an-news__state {
  padding: 20px 14px; text-align: center;
  font-size: 12.5px; color: var(--text-3);
}
.an-news__state .spinner {
  width: 18px; height: 18px; margin: 0 auto 8px;
  border: 2px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: anSpin .8s linear infinite;
}
@keyframes anSpin { to { transform: rotate(360deg); } }

/* ---- 关闭后用来重新唤出的小气泡 ---- */
.an-news-peek {
  position: fixed; left: 18px; bottom: 18px; z-index: 62;
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text-2);
  font-size: 12.5px; font-weight: 700; font-family: inherit; cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
  animation: anIn .4s cubic-bezier(.16, 1, .3, 1) both;
  transition: all .2s;
}
.an-news-peek:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-2px); }
.an-news-peek[hidden] { display: none; }
.an-news-peek i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
  animation: anPulse 1.8s infinite;
}

@media (max-width: 720px) {
  .an-news { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; }
  .an-news-peek { left: 12px; bottom: 12px; }
  .an-news__headline { font-size: 13.5px; }
}

/* ---- 首页轮播图在首屏时自动让位（滚过去之后自动出现）---- */
body.lx-hero-focus .an-news,
body.lx-hero-focus .an-news-peek {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(12px) scale(.98);
}
