/* ============================================================
   Mega Dropdown（顶栏两大分类）+ 首页分类区
   ============================================================ */

/* ---------- 顶栏触发器 ---------- */
#mainHeader .main-header-nav { gap: 1.55rem !important; }
#mainHeader .mega-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: 0 0 .62rem;
    font-size: .95rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color .18s ease, border-color .18s ease;
}
#mainHeader .mega-trigger:hover,
#mainHeader .mega-trigger.on {
    color: #1264e0;
    border-bottom-color: #1264e0;
}
#mainHeader .mega-trigger .mega-caret {
    font-size: .7rem;
    color: #9aa2af;
    transition: transform .2s ease, color .18s ease;
}
#mainHeader .mega-trigger:hover .mega-caret,
#mainHeader .mega-trigger.on .mega-caret { transform: rotate(180deg); color: #1264e0; }
.dark #mainHeader .mega-trigger { color: #cbd5e1; }
.dark #mainHeader .mega-trigger:hover,
.dark #mainHeader .mega-trigger.on { color: #7fb0ff; border-bottom-color: #7fb0ff; }

/* ---------- 面板容器 ---------- */
.mega-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 900;
    display: none;
    background: #fff;
    border-top: 1px solid #eef0f4;
    box-shadow: 0 22px 48px -22px rgba(17, 24, 39, .28), 0 2px 0 rgba(17, 24, 39, .02);
}
.mega-panel.on { display: block; animation: megaIn .18s ease both; }
@keyframes megaIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.mega-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 1.15rem;
    display: grid;
    grid-template-columns: 15.5rem minmax(0, 1fr);
    gap: 2rem;
    max-height: calc(100vh - 118px);
    overflow-y: auto;
}

/* 左栏 */
.mega-aside {
    padding: 1rem 1.15rem 1.15rem;
    border-radius: .85rem;
    background: #f8fafd;
    border: 1px solid #eef1f6;
    align-self: stretch;
}
.mega-aside-t {
    display: flex; align-items: center; gap: .35rem;
    font-size: 1.22rem; font-weight: 700; letter-spacing: -.01em;
    color: #111827;
}
.mega-aside-t i { font-size: .85rem; color: #9aa2af; }
.mega-aside-d {
    margin: .7rem 0 1.1rem;
    font-size: .78rem; line-height: 1.85; color: #8b93a1;
}
.mega-aside-btn {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .52rem 1rem;
    font-size: .78rem; font-weight: 600;
    color: #1264e0; background: #f2f7ff;
    border: 1px solid #dce9fb; border-radius: .5rem;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.mega-aside-btn:hover { background: #e8f1ff; border-color: #c6dcf8; transform: translateX(1px); }
.mega-aside-btn i { font-size: .62rem; }

/* 右主区 */
.mega-main { min-width: 0; }
.mega-promo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1.15rem; }
.mega-promo-card {
    display: block;
    padding: .85rem 1rem;
    border: 1px solid #e9ecf2;
    border-radius: .7rem;
    background: #fbfcfe;
    text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.mega-promo-card:hover { border-color: #cfdcf5; background: #f7faff; box-shadow: 0 10px 22px -20px rgba(18, 100, 224, .8); }
.mega-promo-card .t {
    display: flex; align-items: center; gap: .3rem;
    font-size: .86rem; font-weight: 700; color: #1f2329;
}
.mega-promo-card .t i { font-size: .62rem; color: #9aa2af; transition: transform .16s ease; }
.mega-promo-card:hover .t i { transform: translateX(2px); color: #1264e0; }
.mega-promo-card .d { margin-top: .3rem; font-size: .74rem; line-height: 1.6; color: #8b93a1; }

.mega-groups { display: grid; gap: .6rem 1.6rem; }
.mega-groups.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mega-group { min-width: 0; }
.mega-group-h {
    display: flex; align-items: center; gap: .42rem;
    padding: .3rem 0 .45rem;
    font-size: .74rem; font-weight: 700; letter-spacing: .02em;
    color: #6b7280;
}
.mega-group-h i { font-size: .72rem; color: #b0b8c4; }
.mega-item {
    display: block;
    padding: .34rem .5rem .38rem;
    margin-left: -.5rem;
    border-radius: .45rem;
    text-decoration: none;
    transition: background .14s ease;
}
.mega-item:hover { background: #f5f8fe; }
.mega-item .n {
    display: flex; align-items: center; gap: .35rem;
    font-size: .82rem; font-weight: 600; color: #2b3441;
    transition: color .14s ease;
}
.mega-item:hover .n { color: #1264e0; }
.mega-item .d {
    display: block;
    margin-top: .08rem;
    font-size: .71rem; line-height: 1.5; color: #9aa2af;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mega-tag {
    font-size: .58rem; font-weight: 700; letter-spacing: .04em;
    padding: .05rem .28rem; border-radius: .25rem;
    color: #d4380d; background: #fff1ec; border: 1px solid #ffe0d4;
}
.mega-tag.new { color: #15803d; background: #edfbf2; border-color: #d2f0de; }

.mega-foot {
    margin-top: .85rem;
    padding-top: .7rem;
    border-top: 1px solid #f2f4f8;
    text-align: right;
}
.mega-foot a { font-size: .74rem; color: #8b93a1; text-decoration: none; }
.mega-foot a:hover { color: #1264e0; }
.mega-foot a i { font-size: .6rem; margin-left: .18rem; }

/* 深色 */
.dark .mega-panel { background: #0f1722; border-top-color: #1f2937; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .9); }
.dark .mega-aside { background: #131c28; border-color: #222c39; }
.dark .mega-aside-t { color: #f1f3f7; }
.dark .mega-aside-d { color: #7f8a98; }
.dark .mega-aside-btn { color: #8eb8ff; background: rgba(18, 100, 224, .14); border-color: rgba(18, 100, 224, .3); }
.dark .mega-aside-btn:hover { background: rgba(18, 100, 224, .22); }
.dark .mega-promo-card { background: #131c28; border-color: #232d3a; }
.dark .mega-promo-card:hover { background: #16202d; border-color: #2e3a4a; }
.dark .mega-promo-card .t { color: #e8ecf2; }
.dark .mega-promo-card .d { color: #7f8a98; }
.dark .mega-group-h { color: #8b95a2; }
.dark .mega-item:hover { background: #16202d; }
.dark .mega-item .n { color: #d5dae2; }
.dark .mega-item:hover .n { color: #7fb0ff; }
.dark .mega-item .d { color: #75808e; }
.dark .mega-foot { border-top-color: #1e2836; }
.dark .mega-tag { color: #ff9b76; background: rgba(212, 56, 13, .16); border-color: rgba(212, 56, 13, .3); }
.dark .mega-tag.new { color: #5ee08b; background: rgba(21, 128, 61, .18); border-color: rgba(21, 128, 61, .32); }

/* ============================================================
   首页 · 两大分类
   ============================================================ */
.home-sect-wrap {
    position: relative;
    z-index: 1;
    margin: 1.6rem 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.home-sect {
    padding: 1.5rem 1.6rem 1.5rem;
    border-radius: 1.15rem;
    border: 1px solid #e8ebf1;
    background: #fff;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .035);
}
.home-sect-head {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding-bottom: 1.05rem;
    border-bottom: 1px solid #f2f4f8;
    margin-bottom: 1.15rem;
}
.home-sect-no {
    flex-shrink: 0;
    font-size: .72rem; font-weight: 800; letter-spacing: .06em;
    color: #1264e0;
    padding: .3rem .5rem;
    border-radius: .45rem;
    background: #f0f6ff;
    border: 1px solid #ddeafb;
}
.home-sect-txt { flex: 1; min-width: 0; }
.home-sect-txt h2 {
    margin: 0;
    font-size: 1.24rem; font-weight: 800; letter-spacing: -.01em; color: #111827;
}
.home-sect-txt p { margin: .28rem 0 0; font-size: .79rem; color: #8b93a1; }
.home-sect-more {
    flex-shrink: 0;
    font-size: .77rem; font-weight: 600; color: #1264e0; text-decoration: none;
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .4rem .75rem;
    border-radius: .5rem;
    border: 1px solid #e2ebf9;
    background: #fbfdff;
    transition: all .16s ease;
}
.home-sect-more:hover { background: #f1f7ff; border-color: #cfe1fa; }
.home-sect-more i { font-size: .6rem; }

.home-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .9rem;
}
.home-cat {
    display: flex;
    flex-direction: column;
    padding: 1rem 1rem .75rem;
    border: 1px solid #edf0f5;
    border-radius: .85rem;
    background: #fdfefe;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.home-cat:hover {
    border-color: #dbe6f7;
    box-shadow: 0 16px 30px -26px rgba(17, 24, 39, .6);
    transform: translateY(-2px);
}
.home-cat-h { display: flex; gap: .6rem; align-items: flex-start; }
.home-cat-h .ic {
    flex-shrink: 0;
    width: 2rem; height: 2rem;
    border-radius: .6rem;
    display: flex; align-items: center; justify-content: center;
    font-size: .82rem; color: #1264e0;
    background: #f1f7ff;
    border: 1px solid #e2ecfa;
}
.home-cat-h .tt { min-width: 0; }
.home-cat-h .tt b { display: block; font-size: .87rem; font-weight: 700; color: #1f2329; }
.home-cat-h .tt em {
    display: block; margin-top: .12rem;
    font-style: normal; font-size: .7rem; line-height: 1.5; color: #9aa2af;
}
.home-cat-b { margin-top: .7rem; flex: 1; }
.home-cat-item {
    position: relative;
    display: block;
    padding: .36rem .1rem .38rem;
    text-decoration: none;
    border-bottom: 1px dashed #f3f5f9;
}
.home-cat-item:last-child { border-bottom: 0; }
.home-cat-item .n {
    display: flex; align-items: center; gap: .3rem;
    font-size: .78rem; font-weight: 600; color: #3b4654;
    transition: color .14s ease;
}
.home-cat-item .d {
    display: block;
    margin-top: .08rem; padding-right: .9rem;
    font-size: .69rem; color: #a3aab6;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-cat-item .arr {
    position: absolute; right: .1rem; top: .5rem;
    font-size: .55rem; color: #cbd2dc;
    opacity: 0; transform: translateX(-3px);
    transition: all .16s ease;
}
.home-cat-item:hover .n { color: #1264e0; }
.home-cat-item:hover .arr { opacity: 1; transform: none; color: #1264e0; }
.home-cat-tag {
    font-size: .56rem; font-weight: 700; letter-spacing: .04em;
    padding: .03rem .26rem; border-radius: .22rem;
    color: #d4380d; background: #fff1ec; border: 1px solid #ffe0d4;
}
.home-cat-tag.new { color: #15803d; background: #edfbf2; border-color: #d2f0de; }
.home-cat-f {
    display: inline-flex; align-items: center; gap: .26rem;
    margin-top: .6rem;
    font-size: .72rem; font-weight: 600; color: #6b7280; text-decoration: none;
}
.home-cat-f:hover { color: #1264e0; }
.home-cat-f i { font-size: .55rem; }

/* 深色 */
.dark .home-sect { background: #121a26; border-color: #232c3a; }
.dark .home-sect-head { border-bottom-color: #1f2833; }
.dark .home-sect-no { color: #8eb8ff; background: rgba(18, 100, 224, .16); border-color: rgba(18, 100, 224, .28); }
.dark .home-sect-txt h2 { color: #f1f3f7; }
.dark .home-sect-txt p { color: #7f8a98; }
.dark .home-sect-more { color: #8eb8ff; background: rgba(18, 100, 224, .1); border-color: rgba(18, 100, 224, .26); }
.dark .home-cat { background: #101926; border-color: #222c39; }
.dark .home-cat:hover { border-color: #2e3a4a; box-shadow: none; }
.dark .home-cat-h .ic { color: #8eb8ff; background: rgba(18, 100, 224, .14); border-color: rgba(18, 100, 224, .26); }
.dark .home-cat-h .tt b { color: #e8ecf2; }
.dark .home-cat-h .tt em { color: #7f8a98; }
.dark .home-cat-item { border-bottom-color: #1c2531; }
.dark .home-cat-item .n { color: #cfd6df; }
.dark .home-cat-item:hover .n { color: #7fb0ff; }
.dark .home-cat-item .d { color: #77818e; }
.dark .home-cat-f { color: #9aa5b5; }
.dark .home-cat-f:hover { color: #7fb0ff; }
.dark .home-cat-tag { color: #ff9b76; background: rgba(212, 56, 13, .16); border-color: rgba(212, 56, 13, .3); }
.dark .home-cat-tag.new { color: #5ee08b; background: rgba(21, 128, 61, .18); border-color: rgba(21, 128, 61, .32); }

/* 响应式 */
@media (max-width: 1180px) {
    .mega-inner { grid-template-columns: 12.5rem minmax(0, 1fr); gap: 1.4rem; }
    .mega-groups.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .mega-panel { display: none !important; }
    .home-cat-grid { grid-template-columns: minmax(0, 1fr); }
    .home-sect { padding: 1.15rem 1rem; }
    .home-sect-head { flex-wrap: wrap; }
    .home-sect-more { order: 3; }
}

/* ===== 第三个 Mega 面板：其他 ===== */
.mega-panel-other { max-width: 62rem; margin: 0 auto; }
.mega-inner-other { grid-template-columns: 14.5rem minmax(0, 1fr); padding-bottom: 1rem; }
.mega-groups.cols-3.mega-groups-other { grid-template-columns: 1fr 1.02fr 1.28fr; gap: .6rem 1.7rem; }

.mega-lang-row { display: flex; flex-wrap: wrap; gap: .35rem; padding: .15rem 0 .6rem; }
.mega-lang {
    border: 1px solid #e6e9ef; background: #fff; color: #4b5563;
    border-radius: 99px; padding: .26rem .72rem;
    font-size: .72rem; font-weight: 600; line-height: 1.35;
    cursor: pointer; transition: all .16s ease; font-family: inherit;
}
.mega-lang:hover { color: #111827; border-color: #cbd2dc; transform: translateY(-1px); }
.mega-lang.on {
    color: #fff; background: #111827; border-color: #111827;
    box-shadow: 0 8px 16px -12px rgba(17, 24, 39, .9);
}
.mega-item-theme .n i { margin-right: .32rem; font-size: .74rem; color: #6b7280; }
.dark .mega-lang { background: #151d2a; border-color: #2a3441; color: #cbd5e1; }
.dark .mega-lang:hover { color: #fff; border-color: #4b5563; }
.dark .mega-lang.on { background: #e5e9ef; border-color: #e5e9ef; color: #111827; box-shadow: none; }
.dark .mega-item-theme .n i { color: #94a3b8; }

@media (max-width: 1180px) {
    .mega-groups.cols-3.mega-groups-other { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .mega-groups.cols-3.mega-groups-other { grid-template-columns: 1fr; }
}
