/* ============================================================
   栏目 Mega Menu v3 —— 按截图实测重建：通栏全屏下拉
   面板：100% 屏宽 / 贴头部下沿 / 无圆角无三角 / 底部投影
   内容：870px 居中（1280 视口下左右各 205px 留白，与截图一致）
   结构：左「栏目」分类 200px + 留白 62px + 右「为你推荐」3 卡
   ============================================================ */

/* 关键：让面板定位到 header（sticky 即定位祖先），而非导航项 */
.nav-dropdown-mega { position: static; }

.nav-dropdown-mega .mega-panel {
    position: absolute;
    top: 100%;                          /* 紧贴头部下沿 */
    left: 0;
    right: 0;                           /* 通栏铺满整屏 */
    padding: 30px 0 42px;
    background: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.08);   /* 与下方页面分离 */
    box-sizing: border-box;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

/* 悬停展开（CSS 即时打开 + JS .mega-open 类延迟关闭，二者同时生效） */
.nav-dropdown-mega:hover .mega-panel,
.nav-dropdown-mega.mega-open .mega-panel,
.nav-dropdown-mega .mega-panel:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* 内容区：870px 居中，与截图留白一致 */
.mega-inner {
    display: flex;
    align-items: flex-start;
    max-width: 870px;
    margin: 0 auto;
    padding: 0;
}

/* ---------- 左栏：栏目 ---------- */
.mega-left {
    width: 200px;
    flex-shrink: 0;
    margin-right: 62px;                 /* 与卡片区间纯留白，无分割线 */
}

.mega-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 22px;
}

.mega-links { display: flex; flex-direction: column; }

.mega-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 -14px;
    padding: 15px 14px;                 /* 行距按截图 ~56px */
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.mega-links a:hover { background: #f5f5f5; }

.mega-links a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ---------- 右栏：为你推荐 ---------- */
.mega-right { flex: 1; min-width: 0; }

.mega-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;                          /* 截图卡片间距 */
}

.mega-card {
    display: block;
    min-width: 0;
    text-decoration: none;
}

/* 封面 16:10（截图 177×108），圆角 8，悬停微放大 */
.mega-card-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.mega-card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.mega-card:hover .mega-card-thumb img { transform: scale(1.04); }

/* 视频封面：首帧就绪前完全透明（透出卡片底，零闪烁），loadeddata 后显示第一帧 */
.mega-card-thumb.mega-card-video { background: transparent; }

.mega-card-thumb.mega-card-video video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: transparent;
    opacity: 0;
}

.mega-card-thumb.mega-card-video video.uc-frame-ready { opacity: 1; }

/* 视频播放角标（右下角，与用户中心同款） */
.mega-card-thumb.mega-card-video .uc-play-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.mega-card-thumb.mega-card-video .uc-play-btn::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 10px solid #fff;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    margin-left: 3px;
}

/* 主题切换/淡入时不参与背景过渡，避免封面区域闪出底色层 */
.mega-card-thumb.mega-card-video,
.mega-card-thumb.mega-card-video video {
    transition: none !important;
    background: transparent !important;
}

/* 无封面占位 */
.mega-card-thumb.mega-card-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111111;
}

.mega-card-thumb.mega-card-noimg svg { width: 32px; height: 32px; stroke: #bbbbbb; }

.mega-card-body { padding-top: 14px; }

/* 标题：14.5px 两行截断 */
.mega-card-title {
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.6;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.mega-card:hover .mega-card-title { color: #d93025; }   /* hover 红；想去红改 #1a1a1a */


/* ---------- 悬停切换淡入 ---------- */
.mega-cards { transition: opacity 0.15s ease; }

/* 分类无文章时的占位 */
.mega-cards-empty {
    grid-column: 1 / -1;
    padding: 48px 0;
    text-align: center;
    font-size: 14px;
    color: #999999;
}

/* ============================================================
   暗夜模式（全 !important，压过 style.css 全局灰字规则）
   ============================================================ */
html.dark .nav-dropdown-mega .mega-panel {
    background: #111111 !important;
    border: none !important;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5) !important;
}

html.dark .mega-title { color: #f0f0f0 !important; }

html.dark .mega-links a { color: #cccccc !important; }
html.dark .mega-links a:hover { background: #1a1a1a !important; color: #f0f0f0 !important; }

html.dark .mega-card-title { color: #eeeeee !important; }
html.dark .mega-card:hover .mega-card-title { color: #ff6b6b !important; }

html.dark .mega-card-thumb { background: #1a1a1a !important; }
html.dark .mega-card-thumb.mega-card-noimg svg { stroke: #555555 !important; }

html.dark .mega-cards-empty { color: #666666 !important; }


/* ============================================================
   资源下拉面板 —— 外壳与栏目菜单 100% 统一：通栏全屏 / 贴头部下沿 / 无圆角
   内容：左「资源中心」入口卡（进入=快讯）+ 右「精选内容」4 专题卡（封面+3篇文章）
   ============================================================ */

.nav-dropdown-res { position: static; }

/* 面板外壳与栏目菜单同款 */
.nav-dropdown-res .res-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 30px 0 42px;
    background: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

/* 悬停展开（CSS 即时打开 + JS .res-open 类延迟关闭） */
.nav-dropdown-res:hover .res-panel,
.nav-dropdown-res.res-open .res-panel,
.nav-dropdown-res .res-panel:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.res-inner {
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: fit-content;
    max-width: calc(100vw - 48px);
    margin: 0 auto;
    padding: 0;
}

.res-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 22px;
}

/* ---------- 左：入口大卡（深色渐变 + 图标 + 进入按钮） ---------- */
.res-entry {
    width: 300px;
    flex-shrink: 0;
    margin-right: 30px;
    display: flex;
    flex-direction: column;
}

.res-entry-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px;
    border-radius: 12px;
    text-decoration: none;
    background: linear-gradient(165deg, #14141f 0%, #1e1e30 55%, #43319e 135%);
    transition: filter 0.25s ease, transform 0.25s ease;
}

.res-entry-card:hover {
    filter: brightness(1.12);
    transform: translateY(-2px);
}

.res-entry-icon {
    width: 64px;
    height: 64px;
    color: #ffffff;
    opacity: 0.95;
    margin-bottom: 26px;
}

.res-entry-name {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.res-entry-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.62);
    margin-bottom: 26px;
}

.res-entry-btn {
    padding: 8px 30px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.res-entry-card:hover .res-entry-btn {
    background: rgba(255, 255, 255, 0.28);
}

/* ---------- 右：4 张专题卡（横排层叠压盖 + 上下错落，悬停置顶） ---------- */
.res-right { flex: none; width: 580px; min-width: 0; display: flex; flex-direction: column; }

/* 右栏作为定位锚点 */
.res-right { position: relative; }

/* 容器：绝对定位钉死——上沿 = 标题下（左右标题同高，50px），下沿 = 右栏底 = 左入口卡底，顶底对齐不靠 flex 拉伸 */
.res-cards {
    position: absolute;
    left: 0;
    top: 50px;
    bottom: 0;
    width: 580px;
}

/* 4 张卡绝对定位横排压盖（图片尺寸不变：仍 280px 宽、16:10） */
.res-cards .res-topic-card {
    position: absolute;
    width: 280px;
    margin: 0;
    border: none;                        /* 双保险：任何来源的描边都不显示 */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
    transition: transform 0.25s ease, box-shadow 0.25s ease, z-index 0s;
}

/* 横排压盖；横向压叠多少不等、垂直高低乱跳、角度差异拉大，制造错乱感；悬停归正 */
.res-cards .res-topic-card:nth-child(1) { left: 0;    top: 5%;     z-index: 1; transform: rotate(-6deg); }
.res-cards .res-topic-card:nth-child(2) { left: 90px; top: 22%;    z-index: 2; transform: rotate(2deg); }
.res-cards .res-topic-card:nth-child(3) { left: 230px; bottom: 20%; z-index: 3; transform: rotate(0deg); }
.res-cards .res-topic-card:nth-child(4) { left: 300px; bottom: 3%;  z-index: 4; transform: rotate(-3.5deg); }

/* 封面图：外溢 + 整体微放大双保险，吃掉图片自带的深色边缘/透明边（绿卡左侧黑线的来源）
   放大 1.07 倍后图片四边均超出容器 ~10px，object-fit:cover 保证只裁边不拉伸 */
.res-cards .res-topic-cover img {
    position: absolute;
    inset: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    max-width: none;
    transform: scale(1.07);
    transition: transform 0.35s ease;
}

/* 悬停：压到最前 + 微放大 + 加强投影 */
.res-cards .res-topic-card:hover {
    z-index: 20;
    transform: translateY(-4px) scale(1.02) rotate(0deg);   /* 悬停归正 + GPU 层 */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.res-topic-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
}

/* 专题封面 16:10（尺寸不变） */
.res-topic-cover {
    display: block;
    aspect-ratio: 16 / 10;
    background: #f0f0f0;
    overflow: hidden;
    position: relative;
}

.res-topic-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

/* 悬停放大在 1.07 基础上继续放大（不能小于基础值，否则黑边会重新露出） */
.res-cards .res-topic-card:hover .res-topic-cover img { transform: scale(1.11); }
.res-topic-card:hover .res-topic-cover img { transform: scale(1.05); }

/* 无封面占位 */
.res-topic-cover.res-topic-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f6f6f8 0%, #e9e9ef 100%);
}

.res-topic-cover.res-topic-noimg svg {
    width: 40px;
    height: 40px;
    color: #9a9aa8;
    transition: transform 0.3s ease, color 0.3s ease;
}

.res-topic-card:hover .res-topic-cover.res-topic-noimg svg {
    transform: scale(1.08);
    color: #6a6a78;
}

.res-topic-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #999999;
}

/* ============================================================
   资源面板 · 暗夜模式（全 !important，压过 style.css 全局灰字规则）
   ============================================================ */
html.dark .nav-dropdown-res .res-panel {
    background: #111111 !important;
    border: none !important;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5) !important;
}

html.dark .res-title { color: #f0f0f0 !important; }

/* 入口卡：暗夜下保持深色渐变（本身就暗，无需反色） */
html.dark .res-entry-card {
    background: linear-gradient(165deg, #0c0c14 0%, #14141f 55%, #2c2170 135%) !important;
}
html.dark .res-entry-name { color: #ffffff !important; }
html.dark .res-entry-desc { color: rgba(255, 255, 255, 0.55) !important; }

html.dark .res-topic-card {
    background: #161616 !important;
}

html.dark .res-topic-card:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5) !important; }

html.dark .res-topic-cover { background: #1a1a1a !important; }

html.dark .res-topic-cover.res-topic-noimg {
    background: linear-gradient(135deg, #1c1c22 0%, #121218 100%) !important;
}

html.dark .res-topic-cover.res-topic-noimg svg { color: #555566; }
html.dark .res-topic-card:hover .res-topic-cover.res-topic-noimg svg { color: #8888aa; }

html.dark .res-topic-name { color: #f0f0f0 !important; }
html.dark .res-topic-name:hover { color: #ff6b6b !important; }

html.dark .res-topic-post { color: #909090 !important; }
html.dark .res-topic-post:hover { color: #ff6b6b !important; }
html.dark .res-topic-post::before { color: #444444; }

html.dark .res-topic-none, html.dark .res-topic-none:hover { color: #555555 !important; }
html.dark .res-topic-empty { color: #555555 !important; }


/* ============================================================
   更多下拉面板 —— Prime 风格：小标 + 两行标题 + 彩色图标网格 + 刷微博按钮
   紧凑型浮层卡片（项目少），右对齐触发项
   ============================================================ */

/* 与栏目/资源 100% 同款外壳：通栏全屏 / 贴头部下沿 / 无圆角 / 底部投影 */
.nav-dropdown-more { position: static; }

.nav-dropdown-more .more-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 30px 0 42px;
    background: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

/* 悬停展开（CSS 即时打开 + JS .more-open 类延迟关闭） */
.nav-dropdown-more:hover .more-panel,
.nav-dropdown-more.more-open .more-panel,
.nav-dropdown-more .more-panel:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* 通栏面板无需小三角 */
.nav-dropdown-more .more-caret { display: none; }

.more-main { flex: 0 0 380px; min-width: 0; }

/* PRIME 风格品牌行：蓝色 M 标 + 字标 */
.more-head { margin-bottom: 22px; }

.more-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
}

.more-badge {
    display: block;
    border-radius: 6px;
}

.more-wordmark {
    font-size: 14px;
    font-weight: 800;
    color: #2563eb;
    letter-spacing: 1.5px;
    line-height: 1;
}

/* 两行大标题（PRIME 蓝） */
.more-title {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.4;
    color: #2563eb;
    letter-spacing: -0.3px;
}

/* 2×2 彩色图标网格 */
.more-grid {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-content: start;
    gap: 12px 36px;
}

.more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 0 -10px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.more-item:hover { background: #f5f5f5; }

.more-item svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

/* 右侧刷微博按钮（垂直居中） */
.more-side {
    display: flex;
    align-self: stretch;          /* 拉满主区高度 */
    align-items: center;
    justify-content: flex-end;    /* 按钮沉底，与「图标库」底部对齐 */
    padding-left: 40px;
    margin-left: 40px;
    border-left: 1px solid #f0f0f0;
}

.more-btn {
    display: inline-block;
    padding: 11px 26px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: #2563eb;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease;
}

.more-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* ---------- 暗夜模式 ---------- */
html.dark .nav-dropdown-more .more-panel {
    background: #111111 !important;
    border: none !important;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5) !important;
}

html.dark .more-title { color: #60a5fa !important; }
html.dark .more-wordmark { color: #60a5fa !important; }

html.dark .more-item { color: #cccccc !important; }
html.dark .more-item:hover { background: #1a1a1a !important; color: #f0f0f0 !important; }

html.dark .more-side { border-left-color: #222222; }

html.dark .more-btn {
    background: #2563eb !important;
    color: #ffffff !important;
}

html.dark .more-btn:hover { background: #1d4ed8 !important; }

/* 窄屏兜底：与栏目/资源一致（通栏无需宽度处理），仅收紧按钮区 */
@media (max-width: 1100px) {
    .more-side { padding-left: 24px; margin-left: 20px; }
}