/* ===========================================================
   AI 资讯中心 · V5 前端样式
   保留 V4 浅色背景图与品牌色板，仅增加 V5 结构样式
   =========================================================== */

:root {
  --hb-purple: #7C3AED;
  --hb-magenta: #DB2777;
  --hb-cyan: #06B6D4;
  --hb-brown: #B45309;
  --hb-amber: #F59E0B;
  --hb-cream: #F4F1FB;
  --hb-dark: #1F2430;
  --hb-muted: #6B7280;
  --hb-bg: #0A0820;

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 4px 24px rgba(124, 58, 237, 0.08);
  --radius-card: 20px;
  --radius-pill: 9999px;
  --maxw: 1280px;

  --font-sans: 'Noto Sans SC', 'Outfit', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'Noto Sans SC', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--hb-dark);
  background-color: var(--hb-cream);
  background-image: url('../assets/ainews-bg.jpg');
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px) { .container { padding: 0 24px; } }

/* ---------- 玻璃通用 ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ---------- 顶部导航（玻璃透明，双模块） ---------- */
.glass-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: none;
}
.nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  transition: opacity .2s ease;
}
.brand:hover { opacity: .82; }
.brand-logo {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.brand-logo img { width: 28px; height: 28px; object-fit: contain; }
.brand-name {
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--hb-purple), var(--hb-magenta), var(--hb-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
@media (max-width: 640px) { .brand-name { display: none; } }

/* 双模块切换 */
.nav-modes {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(124,58,237,.12);
  border-radius: var(--radius-pill);
  padding: 4px;
}
.nav-mode {
  position: relative;
  padding: 7px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--hb-muted);
  white-space: nowrap;
  border-radius: var(--radius-pill);
  transition: color .2s, background .2s;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
}
.nav-mode:hover { color: var(--hb-purple); }
.nav-mode.active {
  color: #fff;
  background: linear-gradient(90deg, var(--hb-purple), var(--hb-magenta));
  box-shadow: 0 3px 12px rgba(124,58,237,.25);
}

/* ---------- Hero（居中） ---------- */
.hero {
  padding: 128px 0 32px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.1;
  background: linear-gradient(90deg, var(--hb-purple), var(--hb-magenta), var(--hb-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { font-size: 18px; color: rgba(31,36,48,.7); margin: 0 0 20px; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 14px;
  color: rgba(31,36,48,.6);
}
.hero-stats .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--hb-purple);
  display: inline-block;
  margin-right: 6px;
  animation: pulse 1.8s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ---------- 视图容器 ---------- */
.view { display: none; padding-bottom: 48px; }
.view.active { display: block; }

/* ---------- AI 日报视图（菜单式） ---------- */
.daily-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.date-select { flex-shrink: 0; }
.daily-title-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.daily-title-group h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--hb-purple), var(--hb-magenta) 55%, var(--hb-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
}
.daily-title-group h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--hb-purple), var(--hb-magenta));
}

.date-select {
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(124,58,237,.18);
  background: rgba(255,255,255,.72);
  font-size: 14px;
  color: var(--hb-dark);
  outline: none;
  cursor: pointer;
}

.daily-grid {
  column-count: 2;
  column-gap: 16px;
}
@media (max-width: 768px) { .daily-grid { column-count: 1; } }

.daily-meta {
  text-align: center;
  font-size: 13px;
  color: var(--hb-muted);
  letter-spacing: 0.08em;
  margin-top: 10px;
  font-family: var(--font-display);
}

.daily-section {
  border-radius: var(--radius-card);
  padding: 18px 20px;
  margin-bottom: 16px;
  break-inside: avoid;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: var(--glass-shadow);
}
.daily-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-display);
}
.daily-section-title { display: flex; align-items: center; gap: 10px; }
.daily-section-no {
  font-size: 22px;
  font-weight: 800;
  color: var(--hb-purple);
  line-height: 1;
}
.daily-section-name {
  font-size: 16px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}
.daily-section-name.cat-ai-models { background: rgba(124,58,237,.12); color: var(--hb-purple); }
.daily-section-name.cat-ai-products { background: rgba(219,39,119,.12); color: var(--hb-magenta); }
.daily-section-name.cat-industry { background: rgba(6,182,212,.14); color: var(--hb-cyan); }
.daily-section-name.cat-paper { background: rgba(180,83,9,.12); color: var(--hb-brown); }
.daily-section-name.cat-tip { background: rgba(245,158,11,.16); color: var(--hb-amber); }
.daily-section-name.cat-other { background: rgba(107,114,128,.12); color: var(--hb-muted); }
.daily-section-count {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(124,58,237,.1);
  color: var(--hb-purple);
  white-space: nowrap;
}

.daily-items { display: flex; flex-direction: column; gap: 10px; }
.daily-item {
  display: block;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(124,58,237,.1);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.daily-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(124,58,237,.14);
  border-color: rgba(124,58,237,.28);
}
.daily-item-title { font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--hb-dark); }
.daily-item-sum {
  font-size: 12.5px; line-height: 1.55; color: rgba(31,36,48,.65);
  margin: 6px 0 0;
}
.daily-item-src {
  font-size: 11px; color: var(--hb-purple); margin-top: 6px; display: inline-block; font-weight: 500;
}

/* ---------- 全部视图：当前热点（单卡片纵向列表） ---------- */
.hot-card {
  border-radius: var(--radius-card);
  padding: 18px 20px;
  margin-bottom: 20px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: var(--glass-shadow);
}
.hot-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hot-list { display: flex; flex-direction: column; gap: 2px; }
.hot-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(31,36,48,.07);
}
.hot-item:last-child { border-bottom: none; }
.hot-rank {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  background: rgba(107,114,128,.4);
}
.hot-rank.top1 { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.hot-rank.top2 { background: linear-gradient(135deg, #9CA3AF, #D1D5DB); }
.hot-rank.top3 { background: linear-gradient(135deg, #B45309, #D97706); }
.hot-item .t { font-size: 14px; line-height: 1.4; }
.hot-item .m { font-size: 11px; color: rgba(31,36,48,.5); margin-top: 2px; }

/* ---------- 全部视图：搜索栏（AIHOT 布局） ---------- */
.searchbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.search-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.search-cat {
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  color: var(--hb-muted);
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(124,58,237,.1);
  cursor: pointer;
  transition: .2s;
  white-space: nowrap;
}
.search-cat:hover { color: var(--hb-purple); }
.search-cat.active { color: #fff; background: var(--hb-purple); border-color: transparent; }

.search-main {
  flex: 1 1 320px;
  display: flex;
  gap: 8px;
}
.search-box {
  position: relative; flex: 1;
}
.search-box input {
  width: 100%; height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(31,36,48,.12);
  background: rgba(255,255,255,.72);
  font-size: 14px; color: var(--hb-dark);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus {
  border-color: var(--hb-purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
.search-filters { display: flex; gap: 8px; }
.search-filters select {
  height: 42px; padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(31,36,48,.12);
  background: rgba(255,255,255,.72);
  font-size: 14px; color: var(--hb-dark);
  cursor: pointer; outline: none;
}
.search-btn {
  height: 42px; width: 42px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  border: none;
  background: linear-gradient(90deg, var(--hb-purple), var(--hb-magenta));
  color: #fff; cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.search-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(124,58,237,.3); }

/* ---------- 瀑布流卡片（JS Masonry：绝对定位，最短列填充） ---------- */
.waterfall {
  position: relative;
  min-height: 200px;
}

.card {
  position: absolute;
  box-sizing: border-box;
  border-radius: var(--radius-card);
  padding: 18px;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(124,58,237,.18);
}
.card-img {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  cursor: zoom-in;
}
.card-img img {
  width: 100%; height: auto; display: block;
  object-fit: contain;
  background: rgba(124,58,237,.06);
}
.card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.cat-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
  background: rgba(124,58,237,.12); color: var(--hb-purple);
}
.cat-ai-models { background: rgba(124,58,237,.12); color: var(--hb-purple); }
.cat-ai-products { background: rgba(219,39,119,.12); color: var(--hb-magenta); }
.cat-industry { background: rgba(6,182,212,.14); color: var(--hb-cyan); }
.cat-paper { background: rgba(180,83,9,.12); color: var(--hb-brown); }
.cat-tip { background: rgba(245,158,11,.16); color: var(--hb-brown); }
.cat-other { background: rgba(107,114,128,.12); color: var(--hb-muted); }

.hot-num {
  display: flex; align-items: center; gap: 4px;
  color: var(--hb-amber); font-size: 14px; font-weight: 600;
  font-family: var(--font-display);
}
.card h3 {
  font-size: 16px; font-weight: 600; line-height: 1.4;
  margin: 0 0 8px;
}
.card-summary {
  font-size: 13.5px; line-height: 1.6; color: rgba(31,36,48,.7);
  margin: 0 0 12px;
}
.card-foot {
  display: flex; flex-direction: column;
  gap: 8px;
  padding-top: 12px; border-top: 1px solid rgba(31,36,48,.08);
}
.card-foot .source-line {
  font-size: 12px; color: var(--hb-purple); font-weight: 600;
}
.card-foot .meta-line {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.card-foot .date { font-size: 12px; color: rgba(31,36,48,.55); }
.read-btn {
  padding: 6px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
  border: 1px solid currentColor; background: transparent;
  color: var(--hb-purple);
  transition: all .2s ease; white-space: nowrap;
  flex-shrink: 0;
}
.read-btn:hover { background: var(--hb-purple); color: #fff; border-color: transparent; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(10,8,32,.88);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff; border: none; font-size: 24px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ---------- 骨架屏 ---------- */
.skeleton {
  border-radius: var(--radius-card);
  padding: 20px;
  min-height: 160px;
  margin-bottom: 16px;
  break-inside: avoid;
}
.sk-line {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(124,58,237,.08), rgba(219,39,119,.08), rgba(124,58,237,.08));
  background-size: 200% 100%;
  animation: sk 1.4s infinite;
  margin-bottom: 10px;
}
@keyframes sk { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ---------- 错误 / 空态 ---------- */
.banner {
  border-radius: 14px; padding: 12px 16px; margin-bottom: 16px;
  font-size: 14px;
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.3);
  color: var(--hb-brown);
}

.foot {
  text-align: center; font-size: 13px; color: rgba(31,36,48,.5);
  padding: 24px 0 40px;
}
.foot a { color: var(--hb-purple); }

/* ---------- 无限滚动 sentinel ---------- */
.feed-sentinel {
  display: flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 18px 0 8px;
}
.feed-spinner {
  font-size: 13.5px; color: rgba(31,36,48,.55);
  display: inline-flex; align-items: center; gap: 8px;
}
.feed-spinner::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(124,58,237,.25); border-top-color: var(--hb-purple);
  animation: feed-spin .7s linear infinite;
}
@keyframes feed-spin { to { transform: rotate(360deg); } }
.feed-end {
  font-size: 13.5px; color: rgba(31,36,48,.45);
  letter-spacing: .04em;
}

/* ---------- 返回顶部 ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; z-index: 40;
  color: #fff;
  background: linear-gradient(135deg, var(--hb-purple), var(--hb-magenta));
  box-shadow: 0 6px 20px rgba(124,58,237,.35);
  border: none;
}
.to-top.show { display: flex; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  /* 日报标题与日期选择保持水平一行，避免上下错位 */
  .daily-headline { flex-wrap: nowrap; }
  .date-select { max-width: 55%; }

  /* 全部视图工具栏垂直堆叠，消除换行错位与下方空白 */
  .searchbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .search-main { width: 100%; flex: none; }
  .search-filters { flex-shrink: 0; }
  .search-filters select { width: auto; }
}
