/* ==========================================================================
   Nebula · WordPress 瀑布流浅色主题（模板4）
   - 瀑布流每行 8 列（响应式递减）
   - 浅色系配色
   - 顶部导航吸顶（position: sticky，滚动跟随）
   - 页脚简化：仅友情链接 + 联系链接
   ========================================================================== */

:root {
    --nb-bg: #f5f6f8;
    --nb-surface: #ffffff;
    --nb-surface-2: #f0f1f5;
    --nb-ink: #3a3f4b;
    --nb-heading: #191c23;
    --nb-muted: #8a8f9c;
    --nb-line: #e6e8ee;
    --nb-line-light: #f0f1f5;
    --nb-accent: #6d5ef0;
    --nb-accent-d: #5445d6;
    --nb-dark: #2b2f3a;
    --nb-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.nb-body {
    font-family: var(--nb-font);
    background: var(--nb-bg);
    color: var(--nb-ink);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--nb-ink); text-decoration: none; }
a:hover { color: var(--nb-accent); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.nb-wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* --------------------------------------------------------------------------
   顶部工具条
   -------------------------------------------------------------------------- */
.nb-utilbar { background: #eef0f4; color: #6b7280; font-size: 0.78rem; }
.nb-utilbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.nb-util-date { color: #9aa0ab; }
.nb-util-links a { color: #6b7280; margin-left: 14px; }
.nb-util-links a:hover { color: var(--nb-accent); }

/* --------------------------------------------------------------------------
   站点头部
   -------------------------------------------------------------------------- */
.nb-header { background: var(--nb-surface); border-bottom: 1px solid var(--nb-line); }
.nb-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 18px; padding-bottom: 18px; }
.nb-logo { display: inline-block; font-size: 1.3rem; line-height: 1; font-weight: 800; color: var(--nb-heading); letter-spacing: 0.02em; white-space: nowrap; }
.nb-logo em { font-style: normal; color: var(--nb-accent); }
.nb-logo:hover { color: var(--nb-accent); }
.nb-tagline { font-size: 0.82rem; color: var(--nb-muted); margin-top: 4px; }
.nb-search { display: flex; border: 1px solid var(--nb-line); background: #f7f8fa; max-width: 260px; flex: 0 1 260px; order: 3; border-radius: 3px; overflow: hidden; }
.nb-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; padding: 8px 12px; font-size: 0.9rem; font-family: inherit; color: var(--nb-heading); }
.nb-search input::placeholder { color: var(--nb-muted); }
.nb-search button { border: none; background: var(--nb-accent); color: #fff; padding: 0 18px; font-size: 0.88rem; }
.nb-search button:hover { background: var(--nb-accent-d); }

/* --------------------------------------------------------------------------
   主导航（吸顶，滚动跟随）
   -------------------------------------------------------------------------- */
.nb-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nb-surface);
    border-bottom: 1px solid var(--nb-line);
    box-shadow: 0 1px 3px rgba(20, 24, 40, 0.04);
}
.nb-navbar-inner { display: flex; align-items: center; gap: 14px; min-height: 52px; }
.nb-menu-btn { display: none; background: transparent; border: none; color: var(--nb-heading); font-size: 1.2rem; padding: 12px 14px; }
.nb-nav { display: flex; list-style: none; flex: 1; justify-content: flex-start; order: 2; }
.nb-nav > li { position: relative; }
.nb-nav > li > a { display: block; padding: 12px 18px; color: #444a56; font-size: 0.92rem; }
.nb-nav > li > a:hover { background: var(--nb-bg); color: var(--nb-accent); }
.nb-nav > li > a.is-active { background: var(--nb-accent); color: #fff; }
.nb-drop-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 170px;
    background: #fff;
    border: 1px solid var(--nb-line);
    box-shadow: 0 6px 20px rgba(20, 24, 40, 0.12);
    display: none;
    z-index: 120;
    padding: 6px 0;
}
.nb-nav-drop:hover .nb-drop-menu,
.nb-nav-drop.is-open .nb-drop-menu { display: block; }
.nb-drop-menu a { display: block; padding: 8px 16px; color: var(--nb-ink); font-size: 0.88rem; }
.nb-drop-menu a:hover { background: var(--nb-bg); color: var(--nb-accent); }

/* --------------------------------------------------------------------------
   面包屑
   -------------------------------------------------------------------------- */
.nb-crumbs { font-size: 0.82rem; color: var(--nb-muted); margin-bottom: 14px; }
.nb-crumbs a { color: var(--nb-accent); }
.nb-crumb-sep { margin: 0 8px; color: #b8bdc8; }
.nb-crumb-cur { color: var(--nb-muted); }

/* --------------------------------------------------------------------------
   广告位
   -------------------------------------------------------------------------- */
.nb-adzone { position: relative; border: 1px dashed #d5d8e0; background: #fafbfd; padding: 12px 12px 10px; margin: 16px 0; }
.nb-ad-tag { position: absolute; top: -9px; left: 12px; background: var(--nb-bg); padding: 0 7px; font-size: 0.68rem; letter-spacing: 0.18em; color: var(--nb-muted); }
.nb-adzone-inner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 54px; overflow: hidden; }
.nb-adzone-inner img, .nb-adzone-inner iframe { max-width: 100%; }
.nb-adzone-inner .ad-banner { margin: 4px; }
.nb-adzone-mid { margin-top: 22px; }

/* --------------------------------------------------------------------------
   主内容区（全宽）
   -------------------------------------------------------------------------- */
.nb-layout { padding-top: 24px; padding-bottom: 10px; }
.nb-content { min-width: 0; }
.nb-friendly-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    margin-bottom: 18px;
    padding: 10px 16px;
    background: var(--nb-surface);
    border: 1px solid var(--nb-line);
    border-radius: 8px;
}
.nb-friendly-links a { font-size: 0.85rem; color: var(--nb-muted); }
.nb-friendly-links a:hover { color: var(--nb-accent); }

/* --------------------------------------------------------------------------
   归档页头
   -------------------------------------------------------------------------- */
.nb-archive-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--nb-line); padding-bottom: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.nb-archive-title { font-size: 1.45rem; color: var(--nb-heading); font-weight: 700; }
.nb-archive-count { font-size: 0.85rem; color: var(--nb-muted); }
.nb-archive-search { display: flex; border: 1px solid var(--nb-line); background: var(--nb-surface); margin-bottom: 18px; max-width: 520px; border-radius: 3px; overflow: hidden; }
.nb-archive-search input { flex: 1; min-width: 0; padding: 10px 12px; border: none; outline: none; font-size: 0.9rem; font-family: inherit; background: transparent; color: var(--nb-heading); }
.nb-archive-search input::placeholder { color: var(--nb-muted); }
.nb-archive-search button { border: none; background: var(--nb-accent); color: #fff; padding: 0 20px; font-size: 0.88rem; }
.nb-archive-search button:hover { background: var(--nb-accent-d); }

/* --------------------------------------------------------------------------
   置顶推荐
   -------------------------------------------------------------------------- */
.nb-feature { display: grid; grid-template-columns: 320px 1fr; background: var(--nb-surface); border: 1px solid var(--nb-line); margin-bottom: 22px; transition: border-color 0.18s ease, box-shadow 0.18s ease; }
.nb-feature:hover { border-color: var(--nb-accent); box-shadow: 0 6px 22px rgba(20, 24, 40, 0.08); }
.nb-feature-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(150deg, color-mix(in srgb, var(--c, #6d5ef0) 16%, #f0f1f5), #f0f1f5 72%); }
.nb-feature-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.nb-feature-info { padding: 16px 20px; display: flex; flex-direction: column; justify-content: center; }
.nb-feature-label { align-self: flex-start; font-size: 0.72rem; letter-spacing: 0.12em; background: var(--nb-accent); color: #fff; padding: 2px 9px; margin-bottom: 10px; }
.nb-feature-title { font-size: 1.15rem; color: var(--nb-heading); line-height: 1.5; margin-bottom: 10px; }
.nb-feature:hover .nb-feature-title { color: var(--nb-accent); }

/* --------------------------------------------------------------------------
   瀑布流网格（每行 8 列，响应式递减）
   -------------------------------------------------------------------------- */
.nb-waterfall { column-count: 4; column-gap: 12px; }
.nb-waterfall > * { break-inside: avoid; -webkit-column-break-inside: avoid; margin-bottom: 12px; }
.nb-card-thumb.wf-1 { aspect-ratio: 4 / 5; }
.nb-card-thumb.wf-2 { aspect-ratio: 16 / 10; }
.nb-card-thumb.wf-3 { aspect-ratio: 1 / 1; }
.nb-card-thumb.wf-4 { aspect-ratio: 3 / 4; }

.nb-card { display: flex; flex-direction: column; background: var(--nb-surface); border: 1px solid var(--nb-line); transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease; }
.nb-card:hover { border-color: var(--nb-accent); box-shadow: 0 6px 20px rgba(20, 24, 40, 0.10); transform: translateY(-2px); }
.nb-card-thumb { position: relative; overflow: hidden; background: linear-gradient(150deg, color-mix(in srgb, var(--c, #6d5ef0) 16%, #f0f1f5), #f0f1f5 72%); }
.nb-card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; opacity: 0.97; transition: opacity 0.2s ease; }
.nb-card:hover .nb-card-thumb img { opacity: 1; }
.nb-thumb-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.4rem; letter-spacing: 0.2em; color: rgba(25, 28, 35, 0.18); z-index: 1; }
.nb-duration-badge { position: absolute; right: 6px; bottom: 6px; z-index: 3; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 0.7rem; padding: 1px 6px; border-radius: 2px; }
.nb-card-body { padding: 8px 10px 10px; }
.nb-card-title { font-size: 0.86rem; font-weight: 600; color: var(--nb-heading); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.nb-card:hover .nb-card-title { color: var(--nb-accent); }
.nb-card-meta { margin-top: 6px; font-size: 0.72rem; color: var(--nb-muted); }

/* 瀑布流广告卡片 */
.nb-card-ad {
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 10px;
    overflow: hidden;
    text-align: center;
}
.nb-card-ad .ad-link,
.nb-card-ad .ad-banner { max-width: 100%; }
.nb-card-ad img { max-width: 100%; height: auto; border-radius: 6px; }
.nb-meta-sep { margin: 0 6px; color: #b8bdc8; }
.nb-meta-cat { color: var(--nb-accent); }

/* --------------------------------------------------------------------------
   频道页
   -------------------------------------------------------------------------- */
.nb-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.nb-channel { display: flex; flex-direction: column; gap: 6px; background: var(--nb-surface); border: 1px solid var(--nb-line); border-left: 4px solid var(--c, var(--nb-accent)); padding: 16px 16px 14px; transition: border-color 0.18s ease, box-shadow 0.18s ease; }
.nb-channel:hover { border-color: var(--c, var(--nb-accent)); box-shadow: 0 4px 16px rgba(20, 24, 40, 0.08); }
.nb-channel-name { font-size: 1.05rem; font-weight: 700; color: var(--nb-heading); }
.nb-channel-count { font-size: 0.8rem; color: var(--nb-muted); }

/* --------------------------------------------------------------------------
   公告（文章流）
   -------------------------------------------------------------------------- */
.nb-posts { display: flex; flex-direction: column; gap: 16px; }
.nb-post { background: var(--nb-surface); border: 1px solid var(--nb-line); padding: 18px 20px 16px; }
.nb-post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.nb-post-badge { color: #fff; font-size: 0.72rem; padding: 2px 10px; }
.nb-post-date { font-size: 0.78rem; color: var(--nb-muted); }
.nb-post-title { font-size: 1.2rem; color: var(--nb-heading); margin-bottom: 8px; }
.nb-post-content { font-size: 0.92rem; color: #555b67; white-space: pre-line; }

/* --------------------------------------------------------------------------
   视频详情
   -------------------------------------------------------------------------- */
.nb-article { background: var(--nb-surface); border: 1px solid var(--nb-line); padding: 20px 22px 22px; }
.nb-player-title { font-size: 1.5rem; line-height: 1.45; color: var(--nb-heading); margin-bottom: 10px; }
.nb-player-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--nb-line-light); }
.nb-player-meta { font-size: 0.82rem; color: var(--nb-muted); }
.nb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.nb-action { border: 1px solid var(--nb-line); background: #f7f8fa; color: var(--nb-ink); font-size: 0.86rem; padding: 8px 18px; border-radius: 3px; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.nb-action:hover { background: var(--nb-accent); border-color: var(--nb-accent); color: #fff; }
.nb-action.is-active { background: var(--nb-accent); border-color: var(--nb-accent); color: #fff; }

.nb-player-frame { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; margin-bottom: 14px; }
.nb-player-poster { position: absolute; inset: 0; z-index: 2; background: #111; transition: opacity 0.25s ease; }
.nb-player-poster.is-hidden { opacity: 0; pointer-events: none; }
.nb-player-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.nb-play-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 82px; height: 82px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.92); color: #191c23; font-size: 1.5rem; padding-left: 7px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35); transition: transform 0.18s ease, background 0.18s ease; }
.nb-play-btn:hover { transform: translate(-50%, -50%) scale(1.06); background: var(--nb-accent); color: #fff; }
.nb-player-duration { position: absolute; right: 10px; bottom: 10px; z-index: 3; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 0.78rem; padding: 2px 9px; border-radius: 2px; }
.nb-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: 1; }
.nb-player-error { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: rgba(178, 31, 31, 0.94); color: #fff; padding: 9px 14px; font-size: 0.86rem; }

/* VAST 前贴片层 */
.nb-vast-overlay { position: absolute; inset: 0; z-index: 5; background: #000; }
.nb-vast-overlay video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.nb-vast-badge { position: absolute; top: 12px; left: 12px; z-index: 2; background: rgba(255, 255, 255, 0.9); color: #191c23; font-size: 0.72rem; letter-spacing: 0.22em; padding: 3px 10px; }
.nb-vast-skip { position: absolute; top: 12px; right: 12px; z-index: 2; border: 1px solid rgba(255, 255, 255, 0.7); background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.82rem; padding: 6px 14px; }
.nb-vast-skip:hover { background: var(--nb-accent); border-color: var(--nb-accent); }
.nb-vast-sound { position: absolute; left: 12px; bottom: 12px; z-index: 2; border: 1px solid rgba(255, 255, 255, 0.7); background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.82rem; padding: 6px 14px; }
.nb-vast-sound:hover { background: rgba(109, 94, 240, 0.9); }

/* 播放页广告槽（横向） */
.nb-adslots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0 22px; }
.nb-adslots .nb-side-slot { border: 1px dashed #d5d8e0; background: #fafbfd; padding: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; min-height: 60px; }
.nb-side-slot:empty { display: none; }
.nb-side-slot img, .nb-side-slot iframe, .nb-side-slot .ad-banner { max-width: 100%; }

.nb-related-head { display: flex; align-items: baseline; border-bottom: 2px solid var(--nb-line); padding-bottom: 8px; margin: 22px 0 16px; }
.nb-related-head h2 { font-size: 1.15rem; color: var(--nb-heading); }

/* --------------------------------------------------------------------------
   分页
   -------------------------------------------------------------------------- */
.nb-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 26px 0 6px; flex-wrap: wrap; }
.nb-page { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--nb-line); background: var(--nb-surface); color: var(--nb-ink); font-size: 0.88rem; }
.nb-page:hover { border-color: var(--nb-accent); color: var(--nb-accent); }
.nb-page.is-active { background: var(--nb-accent); border-color: var(--nb-accent); color: #fff; }
.nb-page-gap { border: none; background: transparent; color: var(--nb-muted); }
.nb-page-label { color: var(--nb-muted); }

/* --------------------------------------------------------------------------
   空状态
   -------------------------------------------------------------------------- */
.nb-empty { column-span: all; text-align: center; padding: 60px 20px; color: var(--nb-muted); border: 1px dashed var(--nb-line); background: var(--nb-surface); font-size: 0.92rem; }

/* --------------------------------------------------------------------------
   页脚（简化：友情链接 + 联系链接）
   -------------------------------------------------------------------------- */
.nb-footer { background: #eef0f4; border-top: 1px solid var(--nb-line); margin-top: 34px; }
.nb-footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; padding: 26px 16px; flex-wrap: wrap; }
.nb-footer-group { min-width: 220px; }
.nb-footer-title { font-size: 0.92rem; font-weight: 700; color: var(--nb-heading); margin-bottom: 10px; }
.nb-footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.nb-footer-links a { font-size: 0.86rem; color: #5b6270; }
.nb-footer-links a:hover { color: var(--nb-accent); }
.nb-footer-empty { font-size: 0.84rem; color: var(--nb-muted); }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1280px) {
    .nb-waterfall { column-count: 4; }
}

@media (max-width: 1024px) {
    .nb-waterfall { column-count: 3; }
}

@media (max-width: 900px) {
    .nb-search { max-width: none; flex: 1 1 100%; order: 2; }
    .nb-menu-btn { display: block; margin-left: auto; order: 1; }
    .nb-navbar-inner { flex-wrap: wrap; }
    .nb-nav { display: none; flex-direction: column; flex-basis: 100%; order: 3; }
    .nb-nav.is-open { display: flex; }
    .nb-nav > li > a { padding: 11px 16px; border-top: 1px solid var(--nb-line-light); }
    .nb-nav-drop { position: static; }
    .nb-drop-menu { position: static; box-shadow: none; border: none; background: var(--nb-bg); padding: 0 0 4px 14px; }
    .nb-drop-menu a { color: var(--nb-ink); }
    .nb-drop-menu a:hover { background: transparent; color: var(--nb-accent); }
}

@media (max-width: 768px) {
    .nb-waterfall { column-count: 2; }
    .nb-adslots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nb-feature { grid-template-columns: 1fr; }
    .nb-feature-thumb { aspect-ratio: 16 / 9; }
}

@media (max-width: 560px) {
    .nb-logo { font-size: 1.2rem; }
    .nb-waterfall { column-count: 2; column-gap: 10px; }
    .nb-waterfall > * { margin-bottom: 10px; }
    .nb-channels { grid-template-columns: 1fr 1fr; }
    .nb-article { padding: 14px; }
    .nb-player-title { font-size: 1.2rem; }
    .nb-play-btn { width: 64px; height: 64px; font-size: 1.2rem; }
    .nb-footer-inner { flex-direction: column; gap: 20px; }
}

@media (max-width: 400px) {
    .nb-waterfall { column-count: 1; }
}
