/* =====================================================================
   Cyber-Glass theme layer for Hexo AnZhiYu   (source/css/custom.css)
   Injected via _config.anzhiyu.yml -> inject.head
   ===================================================================== */
:root {
  --cy-blur: 15px;
  --cy-glass-bg: rgba(255, 255, 255, 0.58);
  --cy-glass-border: rgba(255, 255, 255, 0.55);
  --cy-glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.14);
  --cy-neon-a: #00f0ff;
  --cy-neon-b: #ff2bd6;
  --cy-neon-c: #7c4dff;
  --cy-lift: translateY(-6px);
  --cy-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
[data-theme="dark"] {
  --cy-glass-bg: rgba(14, 16, 32, 0.55);
  --cy-glass-border: rgba(0, 240, 255, 0.28);
  --cy-glass-shadow: 0 0 0 1px rgba(0, 240, 255, 0.10), 0 10px 40px rgba(0, 0, 0, 0.55);
}

/* ---------- 1. Glassmorphism cards ---------- */
#nav,
.card-widget,
#recent-posts > .recent-post-item,
#post,
#page,
#archive,
.layout > div:first-child:not(.nc),
#footer-bar,
.post-reward .reward-main,
.author-content.author-content-item,
.bber-item {
  -webkit-backdrop-filter: blur(var(--cy-blur)) saturate(140%);
  backdrop-filter: blur(var(--cy-blur)) saturate(140%);
  background: var(--cy-glass-bg) !important;
  border: 1px solid var(--cy-glass-border) !important;
  box-shadow: var(--cy-glass-shadow) !important;
  border-radius: 16px;
}
#nav { border-radius: 0 0 16px 16px; }

/* ---------- 2. Hover lift ---------- */
#recent-posts > .recent-post-item,
.card-widget,
.bber-item,
.category-lists .category-list-item,
.video-container {
  transition: transform 0.35s var(--cy-ease), box-shadow 0.35s var(--cy-ease), border-color 0.35s;
  will-change: transform;
}
#recent-posts > .recent-post-item:hover,
.card-widget:hover,
.bber-item:hover {
  transform: var(--cy-lift);
}

/* ---------- 3. Neon glow borders (dark mode) ---------- */
[data-theme="dark"] #recent-posts > .recent-post-item:hover,
[data-theme="dark"] .card-widget:hover,
[data-theme="dark"] .bber-item:hover,
[data-theme="dark"] .video-container:hover {
  border-color: var(--cy-neon-a) !important;
  box-shadow:
    0 0 6px rgba(0, 240, 255, 0.65),
    0 0 22px rgba(0, 240, 255, 0.35),
    0 0 46px rgba(255, 43, 214, 0.22),
    inset 0 0 14px rgba(0, 240, 255, 0.10) !important;
}
[data-theme="dark"] #nav,
[data-theme="dark"] #post,
[data-theme="dark"] #page {
  border-color: rgba(124, 77, 255, 0.45) !important;
  box-shadow: 0 0 18px rgba(124, 77, 255, 0.25), var(--cy-glass-shadow) !important;
}
[data-theme="dark"] h1,
[data-theme="dark"] .article-title {
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.45);
}
[data-theme="dark"] a:hover { text-shadow: 0 0 8px rgba(0, 240, 255, 0.6); }

/* ---------- 4. Gradient scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  border-radius: 10px;
  border: 2px solid transparent;
  background: linear-gradient(180deg, var(--cy-neon-a), var(--cy-neon-c) 55%, var(--cy-neon-b)) padding-box;
}
::-webkit-scrollbar-thumb:hover { filter: brightness(1.2) saturate(1.3); }
* { scrollbar-width: thin; scrollbar-color: var(--cy-neon-c) transparent; }

/* ---------- 5. Reward popup (glass) ---------- */
.post-reward .reward-button {
  background: linear-gradient(135deg, var(--cy-neon-c), var(--cy-neon-b)) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(124, 77, 255, 0.45);
}
.post-reward .reward-main {
  padding: 14px;
  box-shadow: var(--cy-glass-shadow), 0 0 28px rgba(124, 77, 255, 0.28) !important;
}
.post-reward .reward-main .reward-all { background: transparent !important; }
.post-reward .reward-main img { border-radius: 12px; }

/* ---------- 6. Responsive 16:9 video container ---------- */
.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.2rem 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--cy-glass-border);
  box-shadow: var(--cy-glass-shadow);
  background: #000;
}
.video-container iframe,
.video-container video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
}
@supports not (aspect-ratio: 16 / 9) {
  .video-container { height: 0; padding-top: 56.25%; }
}

/* ---------- 7. Misc polish ---------- */
::selection { background: rgba(0, 240, 255, 0.35); color: inherit; }
img { border-radius: 10px; }
@media (max-width: 768px) {
  :root { --cy-blur: 10px; }
  #recent-posts > .recent-post-item:hover,
  .card-widget:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =====================================================================
   8. Daily brief + AI nav pages  (source/daily, source/ai-nav)
   ===================================================================== */
.dz-head { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.2rem; }
.dz-tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--cy-glass-border); opacity: .85; }
.dz-h2 { margin: 2rem 0 .9rem !important; }
.dz-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.dz-card, .dz-tool, .dz-video {
  -webkit-backdrop-filter: blur(var(--cy-blur));
  backdrop-filter: blur(var(--cy-blur));
  background: var(--cy-glass-bg);
  border: 1px solid var(--cy-glass-border);
  box-shadow: var(--cy-glass-shadow);
  border-radius: 16px;
  transition: transform .35s var(--cy-ease), border-color .35s, box-shadow .35s;
}
.dz-card { padding: 18px 20px; }
.dz-h { margin: 0 0 .4rem !important; font-size: 1.05rem; color: var(--cy-neon-c); }
.dz-h-ai { color: var(--cy-neon-b); }
.dz-h-fin { color: #b7791f; }
[data-theme="dark"] .dz-h { color: var(--cy-neon-a); }
[data-theme="dark"] .dz-h-fin { color: #fbbf24; }
.dz-list { list-style: none; margin: 0; padding: 0; }
.dz-row { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--cy-glass-border); line-height: 1.5; font-size: .92rem; }
.dz-row:first-child { border-top: 0; }
.dz-row small { display: block; opacity: .7; font-size: .78rem; margin-top: 2px; }
.dz-num { min-width: 1.6rem; font-weight: 700; color: var(--cy-neon-c); }
[data-theme="dark"] .dz-num { color: var(--cy-neon-a); }
.dz-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dz-tab {
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer; color: inherit;
  background: transparent; border: 1px solid var(--cy-glass-border); font: inherit; font-size: .88rem;
}
.dz-tab.on { background: linear-gradient(135deg, var(--cy-neon-c), var(--cy-neon-b)); color: #fff; border-color: transparent; }
.dz-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.dz-video { display: block; padding: 10px; font-size: .88rem; line-height: 1.45; }
.dz-video img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 8px; }
.dz-vt { display: block; font-weight: 600; }
.dz-video small { display: block; opacity: .7; margin-top: 2px; }
.dz-embed { position: relative; aspect-ratio: 16 / 9; grid-column: 1 / -1; border-radius: 16px; overflow: hidden; border: 1px solid var(--cy-glass-border); }
.dz-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.dz-x { min-height: 200px; padding: 12px; }
.dz-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.dz-tool { display: block; padding: 16px 18px; min-height: 44px; }
.dz-tool b { display: block; margin-bottom: 4px; }
.dz-tool span { display: block; font-size: .85rem; opacity: .75; line-height: 1.5; }
.dz-tool:hover, .dz-video:hover { transform: var(--cy-lift); }
[data-theme="dark"] .dz-tool:hover, [data-theme="dark"] .dz-video:hover {
  border-color: var(--cy-neon-a);
  box-shadow: 0 0 6px rgba(0, 240, 255, .55), 0 0 22px rgba(0, 240, 255, .3);
}
.dz-note { margin-top: 1.6rem; font-size: .8rem; opacity: .65; }
@media (max-width: 768px) { .dz-tool:hover, .dz-video:hover { transform: none; } }

/* ===== Home: daily brief inside the big banner box + narrow-screen fallback ===== */
#random-banner.hb-on .banners-title,
#random-banner.hb-on .tags-group-all,
#random-banner.hb-on #tags-group-all { display: none !important; }
#random-banner.hb-on { align-items: stretch; }
.hb-wrap {
  position: relative; z-index: 2; width: 100%; height: 100%; box-sizing: border-box;
  padding: 14px 18px 10px; display: flex; flex-direction: column; gap: 6px; text-align: left;
  background: var(--cy-glass-bg); backdrop-filter: blur(var(--cy-blur)); -webkit-backdrop-filter: blur(var(--cy-blur));
  border: 1px solid var(--cy-glass-border); border-radius: 16px; box-shadow: var(--cy-glass-shadow);
}
.hb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hb-title { font-weight: 700; font-size: 1.05rem; background: linear-gradient(90deg, var(--cy-neon-c), var(--cy-neon-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hb-tabs { display: flex; gap: 6px; }
.hb-tab { min-height: 32px; padding: 0 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .82rem; color: inherit; background: transparent; border: 1px solid var(--cy-glass-border); }
.hb-tab.on { background: linear-gradient(135deg, var(--cy-neon-c), var(--cy-neon-b)); color: #fff; border-color: transparent; }
.hb-more { margin-left: auto; font-size: .8rem; opacity: .8; }
.hb-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; max-height: 250px; }
.hb-list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--cy-glass-border); line-height: 1.4; font-size: .88rem; }
.hb-list li:first-child { border-top: 0; }
.hb-list a { color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.hb-list a:hover { color: var(--cy-neon-c); }
[data-theme="dark"] .hb-list a:hover { color: var(--cy-neon-a); }
.hb-list small { opacity: .6; white-space: nowrap; font-size: .74rem; align-self: center; }
.hb-narrow { display: none; margin: 0 0 16px; }
.hb-narrow .hb-wrap { height: auto; }
@media (max-width: 1200px) { .hb-narrow { display: block; } }
/* video of the day card (#todayCard is reused by home-brief.js) */
#todayCard .todayCard-cover { object-fit: cover; }

/* ===== Categories page: grouped by first-level category ({% topcats %}) ===== */
.cg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cg-card { padding: 16px 18px; border-radius: 16px; background: var(--cy-glass-bg); backdrop-filter: blur(var(--cy-blur)); -webkit-backdrop-filter: blur(var(--cy-blur)); border: 1px solid var(--cy-glass-border); box-shadow: var(--cy-glass-shadow); transition: transform .35s var(--cy-ease), border-color .35s, box-shadow .35s; }
.cg-card:hover { transform: var(--cy-lift); }
[data-theme="dark"] .cg-card:hover { border-color: var(--cy-neon-a); box-shadow: 0 0 6px rgba(0,240,255,.55), 0 0 22px rgba(0,240,255,.3); }
.cg-h { margin: 0 0 8px !important; font-size: 1.1rem; display: flex; justify-content: space-between; align-items: center; }
.cg-count { font-size: .8rem; opacity: .7; border: 1px solid var(--cy-glass-border); border-radius: 999px; padding: 0 10px; }
.cg-kids { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cg-chip { font-size: .8rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--cy-glass-border); }
.cg-posts { list-style: none; margin: 0; padding: 0; font-size: .88rem; line-height: 1.6; }
.cg-posts li { border-top: 1px solid var(--cy-glass-border); padding: 4px 0; }
.cg-posts li:first-child { border-top: 0; }
@media (max-width: 768px) { .cg-card:hover { transform: none; } }

/* picks tab: section chip, random-post link; the theme's hover overlay is hidden while the brief is shown */
#random-banner.hb-on #random-hover { display: none !important; }
.hb-chip { flex: none; align-self: center; font-size: .7rem; line-height: 1; padding: 3px 8px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--cy-neon-c), var(--cy-neon-b)); }
.hb-list li { align-items: center; }
.hb-rand { font-size: .8rem; opacity: .8; cursor: pointer; }
.hb-rand:hover { opacity: 1; color: var(--cy-neon-c); }
[data-theme="dark"] .hb-rand:hover { color: var(--cy-neon-a); }

/* FIX: the theme's star canvas (#peoplecanvas) is a static 359px flex child; it pushed the brief below the 252px overflow:hidden banner, so only the stars were visible. Make it a background layer. */
#random-banner.hb-on #peoplecanvas { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; z-index: 0; pointer-events: none; }
#random-banner.hb-on .hb-wrap { flex: 1 1 auto; min-height: 0; height: 100%; }
