:root { 
    --primary: #007bff; 
    --bg: #ffffff; 
    --orange: #ff7000; 
    --sub-bg: #f8f8f8; 
}
body { margin:0; font-family: sans-serif; background: var(--bg); padding-top: 70px; }
a { text-decoration: none; color: #333; }
* { box-sizing: border-box; }

/* 移动端强制logo容器初始化状态 */
@media (max-width: 768px) {
    .mobile-title {
        transition: none !important;
        transform: none !important;
        left: 0 !important;
    }
    .navbar > div {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        height: 100% !important;
    }
}

/* 全局移除浏览器默认点击高亮 + 添加扩散点击动画 */
* {
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

@keyframes clickRipple {
    0% { transform: scale(0); opacity: 0.6; }
    100% { transform: scale(2); opacity: 0; }
}

.ripple-effect { position: relative; overflow: hidden; }
.ripple-effect .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 123, 255, 0.4);
    transform: scale(0);
    animation: clickRipple 0.6s ease-out;
    pointer-events: none;
}

@media (max-width: 768px) {
    .card, .mobile-menu-btn, .cat-c-item, .cat-p-item, .download-btn, .download-app-btn {
        position: relative;
        overflow: hidden;
    }
}

/* 顶部导航 */
.navbar { 
    position: fixed; top: 0; left: 0; width: 100%; height: 70px; 
    background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.05); z-index: 1000; 
    display: flex; align-items: center; justify-content: center; padding: 0; 
}
.navbar > div {
    width: 100%; max-width: 95vw; min-width: 1200px; display: flex;
    align-items: center; justify-content: space-between; padding: 0 15px; box-sizing: border-box;
}

/* ========== PC端全屏幕自适应统一宽度 ========== */
@media (min-width: 769px) {
  .navbar > div,
  .carousel-wrap,
  .notice-bar,
  .container {
    max-width: 90% !important;
    min-width: unset !important;
    width: 90% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
@media (max-width: 768px) {
    .navbar > div { min-width: unset !important; max-width: 100% !important; padding: 0 10px !important; }
}

.mobile-menu-btn, .mobile-title { display: none; }
.nav-logo img { height: 90px; }
.nav-center { flex: 1; display: flex; justify-content: center; align-items: center; gap: 20px; }
.nav-menu { display: flex; gap: 25px; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav-item { position: relative; font-size: 15px; font-weight: 500; cursor: pointer; }
.nav-item > a > i.fa-chevron-down { font-size: 12px; margin-left: 5px; transition: transform 0.3s ease; transform-origin: center; }
.nav-item:hover > a > i.fa-chevron-down { transform: rotate(180deg); }

@media (max-width: 768px) {
    .nav-item > a > i.fa-chevron-down { transition: none; transform: none !important; }
}
@media (min-width: 2560px) {
    .nav-item { font-size: 18px; }
    .sub-menu a { font-size: 16px; padding: 12px 20px; }
}
@media (min-width: 3840px) {
    .nav-item { font-size: 20px; }
    .sub-menu a { font-size: 18px; padding: 14px 20px; }
}

.nav-item a { color: #555; display: block; padding: 10px 0; }
.nav-item:hover > a { color: var(--primary); }

.sub-menu { 
    display: none; position: absolute; top: 100%; left: -15px; background: #fff; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); border-radius: 4px; min-width: 140px; 
    max-width: 300px; padding: 5px 0; list-style: none; z-index: 1001; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.nav-item:hover .sub-menu { display: block; }
.sub-menu a { padding: 10px 20px; white-space: nowrap; display: block; overflow: hidden; text-overflow: ellipsis; }
.sub-menu a:hover { background: #f5f5f5; color: var(--primary); }

/* 搜索框 */
.nav-search-pc form { display: flex; }
.nav-search-pc input { padding: 8px 15px; border-radius: 20px 0 0 20px; border: 1px solid #ddd; border-right: none; outline: none; width: 200px; background: #f9f9f9; font-size: 14px; }
.nav-search-pc button { padding: 8px 15px; border-radius: 0 20px 20px 0; border: 1px solid #ddd; background: var(--primary); color: #fff; cursor: pointer; font-size: 14px; }

@media (min-width: 2560px) {
    .nav-search-pc input { width: 280px; padding: 10px 20px; font-size: 16px; }
    .nav-search-pc button { padding: 10px 20px; font-size: 16px; }
}
@media (min-width: 3840px) {
    .nav-search-pc input { width: 350px; padding: 12px 25px; font-size: 18px; }
    .nav-search-pc button { padding: 12px 25px; font-size: 18px; }
}

.nav-right { display: flex; align-items: center; gap: 15px; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; cursor: pointer; border: 1px solid #eee; z-index: 9999 !important; position: relative !important; }

@media (max-width: 768px) {
    .user-avatar { width: 45px !important; height: 45px !important; margin-right: 5px !important; z-index: 9999 !important; position: relative !important; pointer-events: auto !important; }
}
.user-dropdown { position: absolute; top: 60px; right: 20px; background: #fff; width: auto; min-width: 140px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); border-radius: 12px; display: none; flex-direction: column; overflow: hidden; z-index: 9999 !important; }

@media (max-width: 768px) {
    .user-dropdown { right: 10px !important; top: 70px !important; z-index: 9999 !important; position: fixed !important; width: auto !important; min-width: 140px !important; max-width: 90vw !important; }
}
.user-dropdown.show { display: flex; }
.user-dropdown div { padding: 12px 20px; cursor: pointer; text-align: center; border-bottom: 1px solid #eee; font-size: 13px; white-space: nowrap; }
.user-dropdown div:last-child { border-bottom: none; padding-top: 12px; padding-bottom: 6px; }
.user-dropdown div:hover { background: #f5f5f5; color: var(--primary); }
.btn-login { background: var(--primary); color: #fff; padding: 6px 20px; border-radius: 20px; font-size: 14px; border: none; cursor: pointer; }
.btn-login:hover { background: #0056b3; }

/* 移动端菜单 */
.mobile-menu-overlay {
    position: fixed;
    top: 70px;
    left: -100%;
    margin-left: 10px; /* 左边不贴屏幕 */
    width: auto !important;
    min-width: 120px;
    max-width: 200px;
    height: auto !important;
    max-height: calc(100vh - 70px);
    background: #fff;
    z-index: 9999 !important;
    /* 修改后的阴影：四周均匀、扩散更小 */
    box-shadow: 0 0 6px rgba(0,0,0,0.1) !important;
    transition: left 0.3s ease-in-out !important;
    padding: 10px 20px !important;
    border-radius: 12px !important; /* 四边都圆角 */
    display: inline-block !important;
    margin-bottom: 0 !important;
    pointer-events: auto;
}
.mobile-menu-overlay.show {
    left: 0;
}
.m-menu-item { padding: 10px 0 !important; border-bottom: none !important; font-size: 14px !important; font-weight: normal !important; cursor: pointer; white-space: nowrap; }
.m-menu-item:last-child { margin-bottom: 6px !important; }

.mobile-submenu { transition: all 0.3s ease; }
.m-submenu-item { padding: 8px 0 !important; font-size: 13px !important; border-bottom: none !important; }
.has-submenu .submenu-icon { transition: transform 0.3s ease; }
.has-submenu.open .submenu-icon { transform: rotate(180deg); }
.has-submenu > a { pointer-events: none; }
.has-submenu .mobile-submenu a { pointer-events: auto; }

/* 轮播图 */
.carousel-wrap { max-width: 95vw; min-width: 1200px; margin: 10px auto; width: 100%; position: relative; overflow: hidden; border-radius: 8px; height: var(--banner-h); padding: 0 2vw; box-sizing: border-box; }
.carousel-indicators { position: absolute; bottom: 15px; left: 0; width: 100%; display: flex; justify-content: center; gap: 8px; z-index: 10; }
.carousel-indicator { width: 30px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.5); cursor: pointer; transition: all 0.3s ease; }
.carousel-indicator.active { background: #007bff; width: 40px; }
.carousel-indicator:hover:not(.active) { background: rgba(255, 255, 255, 0.8); }


@media (min-width: 2560px) {
    .carousel-wrap { max-width: 90vw; min-width: 1750px; }
}
@media (max-width: 768px) {
    .carousel-wrap { min-width: unset !important; max-width: 100% !important; padding: 0 10px !important; height: var(--banner-h) !important; min-height: 150px !important; display: block !important; }
    .carousel-wrap .carousel .slide img { width: 100% !important; height: 100% !important; object-fit: cover !important; }
    .carousel-indicator { width: 15px !important; height: 4px !important; border-radius: 2px !important; }
    .carousel-indicator.active { width: 25px !important; }
    .carousel-indicators { gap: 5px !important; }
}

.carousel { width: 100%; height: 100%; position: relative; overflow: hidden; }
.slide { width: 100%; height: 100%; position: absolute; left: 0; transform: translateX(100%); transition: transform 0.5s ease-in-out; opacity: 1; }
.slide.active { transform: translateX(0); z-index: 1; }
.slide.prev { transform: translateX(-100%); z-index: 0; }
.slide img { width: 100%; height: 100%; object-fit: cover; }

/* 公告栏 */
.notice-bar { max-width: 95vw; min-width: 1200px; margin: 10px auto; margin-top: 20px; width: 100%; background: #fff8e1; color: #d32f2f; padding: 10px 2vw; font-size: 15px; font-weight: bold; border-radius: 4px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
@media (min-width: 769px) { .notice-bar { text-align: center; } }


@media (max-width: 768px) {
    .notice-bar { padding: 10px 10px; width: 92%; max-width: 100% !important; min-width: unset !important; box-sizing: border-box; font-size: 15px; font-weight: bold; overflow: hidden; }
}

.notice-scroll-container { width: 100%; overflow: hidden; position: relative; }
.notice-scroll-content { display: inline-block; white-space: nowrap; will-change: transform; }
@keyframes noticeScroll { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
@supports (-webkit-overflow-scrolling: touch) { .notice-scroll-content { -webkit-transform: translateZ(0); transform: translateZ(0); } }

/* 主容器 */
.container {
    max-width: 95vw;
    min-width: 1200px;
    width: 100%;
    margin: 20px auto;
    padding: 0;
    box-sizing: border-box;
}


@media (max-width: 768px) { 
    .container { 
        max-width: none !important; 
        min-width: unset !important; 
        width: 90% !important; 
        padding: 0 !important; 
        box-sizing: border-box; 
        margin: 20px auto; 
    } 
}

/* 分类样式 - PC端不变 */
.cat-parent { display: flex; flex-wrap: wrap; column-gap: 0px; row-gap: 15px; margin-top: 25px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: none; padding-left: 0px; font-weight: 400; }
.cat-p-item { font-size: 16px; font-weight: normal !important; cursor: pointer; padding: 8px 15px; border-bottom: 2px solid transparent; color: #555; text-decoration: none; }
.cat-p-item.active { border-color: var(--primary); color: var(--primary); }
.cat-p-item:hover { color: #007bff !important; cursor: pointer; }

/* 移动端分类样式 */
@media (max-width: 768px) {
    .cat-p-item { 
        padding: 10px 16px; 
        background: var(--sub-bg); 
        border-radius: 20px; 
        color: #666; 
        font-size: 15px; 
        border-bottom: none; 
        border: none; 
    }
    .cat-p-item.active { 
        background: rgba(24, 144, 255, 0.1); 
        color: #1890ff; 
        font-weight: normal; 
        transform: translateY(0px); 
    }
    body .container .cat-parent {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        gap: 12px 8px !important; /* 第一个值=左右间距，第二个值=上下间距 */
        padding: 5px !important;
        margin: -10px 0 15px 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    /* 兜底：直接给分类项加间距 */
    body .container .cat-parent .cat-p-item {
        margin: 0 6px 6px 0px !important; /* 上下8px，左右6px，改8px即可 */
    }
}
    .container .cat-child { 
        display: flex; 
        flex-wrap: wrap; 
        gap: 2px !important;
        row-gap: 12px !important;
        margin-top: 10px !important; 
        margin-bottom: 20px !important; 
        padding: 15px 12px 15px 10px !important;
        background: var(--sub-bg); 
        border-radius: 8px; 
        box-sizing: border-box !important;
    }
    .container .cat-c-item { 
        cursor: pointer; 
        padding: 7px 16px !important; 
        background: #ffffff; 
        border-radius: 15px; 
        color: #666; 
        font-size: 14px; 
        text-decoration: none; 
        transition: all 0.2s; 
        box-sizing: border-box !important;
        margin: 0 !important; 
        margin-left: 10px !important;
    }
    .cat-c-item:hover { background: #e0e7ff; }
    .cat-c-item.active { 
        background: #1890ff; 
        color: #fff; 
        box-shadow: none; 
        border-radius: 15px; 
        font-weight: bold;
        transform: translateY(0px); 
        transition: all 0.2s ease; 
    }
}

/* PC端子分类样式 */
.container .cat-child { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
    margin-top: 10px; 
    margin-bottom: 20px; 
    padding: 15px 20px !important;
    background: var(--sub-bg); 
    border-radius: 8px; 
    box-sizing: border-box !important;
}
.container .cat-c-item { 
    cursor: pointer; 
    padding: 7px 14px !important;
    background: #ffffff; 
    border-radius: 15px; 
    color: #666; 
    font-size: 16px; 
    text-decoration: none; 
    transition: all 0.2s; 
    box-sizing: border-box !important;
}
.cat-c-item:hover { background: #e0e7ff; }
.cat-c-item.active { background: #1890ff; color: #fff; box-shadow: none; border-radius: 15px; font-weight: bold; transform: translateY(0px); transition: all 0.2s ease; }

@media (min-width: 2560px) {
    .cat-p-item { font-size: 18px; padding: 10px 20px; }
    .cat-c-item { font-size: 18px; padding: 10px 25px; border-radius: 18px; }
}
@media (min-width: 3840px) {
    .cat-p-item { font-size: 20px; padding: 12px 25px; }
    .cat-c-item { font-size: 20px; padding: 12px 30px; border-radius: 20px; }
}

/* 搜索框 (移动端) */
.search-mobile { display: none; margin: 15px 0; }
@media (max-width: 768px) { .search-mobile { display: block; margin: 20px 0 !important; } }
.search-mobile form { display: flex; width: 100%; }
.search-mobile input { flex: 1; padding: 10px; border: 1px solid #ddd; border-right: none; border-radius: 4px 0 0 4px; background: #fff; }
.search-mobile button { padding: 10px 15px; background: var(--primary); color: #fff; border: none; border-radius: 0 4px 4px 0; }

/* 网格系统与卡片 */
.grid { display: grid; grid-template-columns: repeat(5, 1fr); column-gap: 20px; row-gap: 18px; }
@media (min-width: 769px) and (max-width: 1199px) { .grid { grid-template-columns: repeat(4, 1fr); column-gap: 15px; } }
@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 16px !important;
        row-gap: 22px;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* 基础卡片样式 - 保留移动端原有样式，PC端单独覆盖 */
.card { 
    background: #fff; 
    border-radius: 6px; 
    overflow: hidden; 
    transition: 0.2s; 
    box-shadow: 0 1px 6px rgba(0,0,0,0.2); 
    cursor: pointer; 
    position: relative; 
}
.card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 8px 15px rgba(0,0,0,0.1); 
}

/* PC端卡片样式修改：16:9比例、四周均匀阴影、更大圆角 */
@media (min-width: 769px) {
    .card {
        /* 增大圆角 */
        border-radius: 12px !important;
        /* 四周均匀的浅灰色阴影（x偏移、y偏移、模糊、扩散、颜色） */
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1) !important;
        /* 移除描边 */
        border: none !important;
    }
    .card:hover {
        /* 悬停时位移+阴影稍加深，保持均匀感 */
        transform: translateY(-3px);
        box-shadow: 0 0 12px rgba(0, 0, 0, 0.12) !important;
        /* 移除悬停时的描边颜色（因为已经删了描边） */
        border-color: transparent !important;
    }
    /* PC端卡片缩略图改为16:9比例 */
    .card .thumb {
        padding-bottom: 56.25% !important; /* 16:9 = 9/16 = 56.25% */
    }
}

/* 卡片缩略图容器 */
.thumb { 
    padding-bottom: 68%; 
    position: relative; 
    background: #fff;
    width: 100% !important;
    height: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
.thumb img { 
    position: absolute !important; 
    width: 100% !important; 
    height: 100% !important; 
    object-fit: cover !important;
    top: 0 !important;
    left: 0 !important;
    transform: translate(0, 0) !important;
    margin: 0 !important;
    border: none !important;
}

/* 移动端缩略图专属适配 */
@media (max-width: 768px) {
    .card .thumb {
        padding-bottom: 70% !important;
        position: relative !important;
        width: 100% !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    .card .thumb img {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        transform: none !important;
        margin: 0 !important;
    }
}

/* 标签 */
.tag-original { position: absolute; top: 8px; left: 8px; background-color: #dc3545; color: #fff; font-size: 16px; padding: 6px 16px; border-radius: 6px; z-index: 2; font-weight: bold; }
.tag-new { position: absolute; top: 8px; right: 8px; background: linear-gradient(90deg, #28a745, #97d700); color: #fff; font-size: 18px; padding: 8px 18px; border-radius: 8px; z-index: 2; font-weight: bold; }
.tag-copyright { position: absolute; top: 8px; z-index: 2; font-weight: bold; }



/* PC端标签改用vw单位，自动适配所有大屏 */
@media (min-width: 769px) {
    .tag-original, .tag-new, .tag-collect, .tag-copyright { 
        font-size: 0.6vw !important;
        padding: 0.2vw 0.4vw !important;
        border-radius: 0.25vw !important;
    }
    /* 公告栏 vw 适配 */
    .notice-bar {
        font-size: 0.7vw !important;
        padding: 0.5vw 2vw !important;
        border-radius: 0.25vw !important;
    }
    
     .nav-search-pc button {
        padding: 0.5vw 1vw !important;
        font-size: 0.7vw !important;
        border-radius: 0 2vw 2vw 0 !important;
    }
}



/* 移动端标签尺寸统一 */
@media (max-width: 768px) {
    .tag-original, .tag-new { font-size: 11px !important; padding: 3px 7px !important; border-radius: 4px !important; }
    .tag-collect, .tag-copyright { font-size: 11px !important; padding: 3px 7px !important; border-radius: 4px !important; }
    .tag-original[style*="linear-gradient(90deg, #9d4edd, #7b2cbf)"] { font-size: 11px !important; padding: 3px 7px !important; }
}

.audio-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 60px; height: 60px; border-radius: 50%; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; transition: 0.3s; border: 2px solid #fff; }
.card:hover .audio-icon { animation: spin 2s linear infinite; background: var(--primary); }
@keyframes spin { 100% { transform: translate(-50%, -50%) rotate(360deg); } }

.card-footer { margin-top: 10px; display: flex; justify-content: center; align-items: center; padding: 0 15px; width: 100%; box-sizing: border-box; }
.card-title { font-size: 14px; color: #333; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
@media (min-width: 2560px) { .card-title { font-size: 16px; } }
@media (min-width: 3840px) { .card-title { font-size: 18px; } }
.preview-btn { display: none; }

/* 弹窗及响应式 */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 2000; align-items: center; justify-content: center; }
.modal-box { background: #fff; padding: 30px; border-radius: 12px; text-align: center; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }

@media (min-width: 769px) {
    #itemModal .modal-box { width: 1200px !important; max-width: 95% !important; padding: 20px !important; min-height: 80vh !important; }
    #itemModal.no-video-url .modal-box { max-width: fit-content !important; min-width: 300px !important; padding: 20px 30px !important; }
    #loginModal .modal-box, #passModal .modal-box { width: 400px !important; max-width: 95% !important; padding: 30px !important; }
    #kfModal .modal-box { width: 400px !important; height: 400px !important; padding: 20px !important; }
}
@media (min-width: 2560px) {
    #itemModal .modal-box { width: 1600px !important; max-width: 88% !important; padding: 40px !important; min-height: 88vh !important; font-size: 18px !important; }
    #itemModal .modal-title-bar h3 { font-size: 32px !important; }
    #itemModal.no-video-url .modal-box { min-width: 500px !important; padding: 40px 50px !important; }
    #itemModal .material-image-bar img, #itemModal .material-image-bar video { max-height: 750px !important; }
    #itemModal .download-btn { padding: 15px 50px !important; font-size: 20px !important; }
    #loginModal .modal-box, #passModal .modal-box { width: 550px !important; padding: 45px !important; }
    #kfModal .modal-box { width: 550px !important; height: 550px !important; padding: 40px !important; }
}
@media (min-width: 3840px) {
    #itemModal .modal-box { width: 2400px !important; max-width: 82% !important; padding: 50px !important; min-height: 92vh !important; font-size: 20px !important; }
    #itemModal .modal-title-bar h3 { font-size: 36px !important; }
    #itemModal.no-video-url .modal-box { min-width: 600px !important; padding: 50px 60px !important; }
    #itemModal .material-image-bar img, #itemModal .material-image-bar video { max-height: 850px !important; }
    #itemModal .download-btn { padding: 18px 60px !important; font-size: 22px !important; }
    #loginModal .modal-box, #passModal .modal-box { width: 650px !important; padding: 55px !important; }
    #kfModal .modal-box { width: 650px !important; height: 650px !important; padding: 50px !important; }
}
@media (max-width: 768px) {
    #itemModal .modal-box { width: 380px !important; max-width: 95% !important; padding: 15px !important; min-height: 70vh !important; }
    #loginModal .modal-box, #passModal .modal-box { width: 320px !important; max-width: 95% !important; }
    #kfModal .modal-box { width: 300px !important; height: 300px !important; padding: 20px !important; }
    .modal-arrow { width: 40px !important; height: 40px !important; }
    .modal-arrow i { font-size: 16px !important; }
}

#itemModal .modal-box { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; position: relative; height: auto !important; min-height: unset !important; }
.modal-title-bar { width: 100%; padding: 15px 0; border-bottom: 1px solid #eee; margin-bottom: 20px; text-align: center; display: flex; justify-content: center; align-items: center; gap: 15px; }
.modal-title-bar h3 { font-size: 24px; margin: 0; color: #333; }
.material-image-bar { width: 100%; display: flex; align-items: center; justify-content: center; padding: 10px 0; height: auto; min-height: unset; }
.material-image-bar img { max-width: 100%; max-height: 500px; width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: none !important; }
.download-bar { width: 100%; padding: 20px 0; border-top: 1px solid #eee; margin-top: 20px; }
@media (min-width: 769px) { .download-bar { position: relative; bottom: auto; right: auto; width: 100%; border-top: 1px solid #eee; margin-top: 20px; padding: 10px 0; text-align: right; } }
.download-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 40px; background: var(--primary); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 18px; box-shadow: 0 4px 12px rgba(0,123,255,0.2); }
@media (min-width: 769px) { .download-btn { padding: 10px 30px; font-size: 16px; } }
.download-btn:hover { background: #0056b3; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,123,255,0.3); }
.close-btn { position: absolute; top: 20px; right: 20px; font-size: 30px; cursor: pointer; color: #999; transition: all 0.2s; z-index: 10; }
.close-btn:hover { color: #333; transform: scale(1.1); }
.modal-input { width: 100%; padding: 12px; border: 1px solid #ddd; margin-bottom: 15px; border-radius: 8px; font-size: 16px; }
.modal-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(0,123,255,0.1); }
.modal-btn { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 16px; transition: all 0.2s; }
.modal-btn:hover { background: #0056b3; box-shadow: 0 4px 12px rgba(0,123,255,0.2); }

.login-extra { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 16px; }
.remember-pwd { display: flex; align-items: center; gap: 8px; color: #666; }
.remember-pwd input { width: 18px; height: 18px; }
.buy-material { display: flex; align-items: center; gap: 8px; color: var(--orange); cursor: pointer; transition: all 0.2s; }
.buy-material:hover { color: #ff5500; transform: translateY(-2px); }

#kfModal .modal-box { display: flex; flex-direction: column; align-items: center; justify-content: center; }
#kfModal img { width: 80%; height: 80%; object-fit: contain; border-radius: 8px; margin-bottom: 15px; }
#kfModal p { font-size: 18px; color: #666; margin: 0; }

.auth-modal-box { width: 900px !important; max-width: 95%; text-align: left; height: 85vh; display:flex; flex-direction:column; }
.auth-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.auth-card { border: 1px solid #eee; padding: 20px; border-radius: 12px; transition: all 0.2s; }
.auth-card:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

@media (max-width: 768px) {
    .nav-logo, .nav-center { display: none; }
    .mobile-menu-btn { display: flex; align-items: center; order: 1; font-size: 24px !important; cursor: pointer; margin-right: 15px; padding: 5px !important; flex-shrink: 0; width: 40px; height: 40px; justify-content: center; position: relative; z-index: 1001; }
    .mobile-title { display: flex; align-items: center; justify-content: center; order: 2; width: 100%; flex-shrink: 1; flex-grow: 1; font-weight: normal; font-size: 18px; cursor: pointer; height: 100%; padding: 0 !important; margin: 0 !important; overflow: hidden; position: relative; z-index: 1001; } 
    .mobile-title img { width: auto !important; height: 38px !important; object-fit: contain !important; position: relative !important; margin: 0 auto !important; left: unset !important; transform: none !important; }
    .nav-right { order: 3; display: flex; align-items: center; padding-right: 5px !important; margin-right: 0 !important; flex-shrink: 0; width: auto !important; min-width: 60px; position: relative; z-index: 9999 !important; }
    .navbar { justify-content: space-between; display: flex; align-items: center; height: 70px; padding: 0 10px !important; margin: 0 !important; width: 100vw !important; box-sizing: border-box; position: fixed; top: 0; left: 0; z-index: 1000; overflow: hidden; }
    .material-image-bar img { max-height: 350px; }
}

/* 视频/应用白框高度压缩 */
body div:has(> .grid > .card > .thumb > .audio-icon[style*="border-radius:0"]) ~ .card-box,
body div:has(> .grid > .card > .thumb > .audio-icon[style*="border-radius:0"]) .card-box { padding: 6px 15px !important; margin-bottom: 15px !important; }
body div:has(> .grid > .card > .thumb > .audio-icon[style*="border-radius:0"]) .cat-parent { row-gap: 8px !important; margin-top: 8px !important; margin-bottom: 8px !important; padding-bottom: 8px !important; }
body div:has(> .grid > .card > .card-info > .download-app-btn) ~ .card-box,
body div:has(> .grid > .card > .card-info > .download-app-btn) .card-box { padding: 6px 15px !important; margin-bottom: 15px !important; }
body div:has(> .grid > .card > .card-info > .download-app-btn) .cat-parent { row-gap: 8px !important; margin-top: 8px !important; margin-bottom: 8px !important; padding-bottom: 8px !important; }

@media (max-width: 768px) {
  #itemModal .material-image-bar > div { max-height: 220px !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
}

/* 自定义美化弹窗样式 */
.custom-alert-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 99999; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.custom-alert-overlay.show { opacity: 1; visibility: visible; }
.custom-alert-box { background: #fff; border-radius: 12px; padding: 30px 40px; max-width: 90%; width: 400px; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); transform: scale(0.8); transition: transform 0.3s ease; }
.custom-alert-overlay.show .custom-alert-box { transform: scale(1); }
.custom-alert-text { font-size: 16px; color: #333; margin-bottom: 25px; line-height: 1.5; }
.custom-alert-btn { padding: 10px 30px; background: #007bff; color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; transition: all 0.2s ease; }
.custom-alert-btn:hover { background: #0056b3; box-shadow: 0 4px 12px rgba(0,123,255,0.2); }

.custom-confirm-box { background: #fff; border-radius: 12px; padding: 30px 40px; max-width: 90%; width: 400px; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
.custom-confirm-text { font-size: 16px; color: #333; margin-bottom: 25px; line-height: 1.5; }
.custom-confirm-btns { display: flex; gap: 15px; justify-content: center; }
.custom-confirm-btn { padding: 10px 25px; border-radius: 8px; font-size: 16px; cursor: pointer; transition: all 0.2s ease; border: none; }
.custom-confirm-cancel { background: #f5f7fa; color: #666; }
.custom-confirm-cancel:hover { background: #e9ecef; }
.custom-confirm-ok { background: #007bff; color: #fff; }
.custom-confirm-ok:hover { background: #0056b3; }

/* 首页全屏加载动画样式 */
#global-loader { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: linear-gradient(135deg, #4776E6 0%, #8E54E9 100%); z-index: 9999999; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.4s ease, visibility 0.4s ease; }
#global-loader.hidden { opacity: 0; visibility: hidden; }
.loader-spinner { width: 80px; height: 80px; border: 6px solid rgba(255, 255, 255, 0.2); border-top: 6px solid #ffffff; border-radius: 50%; animation: loader-spin 1s linear infinite; margin-bottom: 20px; box-shadow: 0 0 20px rgba(255, 255, 255, 0.25), inset 0 0 10px rgba(255, 255, 255, 0.1); transform-origin: center center; }
@keyframes loader-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loader-text { color: #ffffff; font-size: 20px; letter-spacing: 2px; font-weight: bold; animation: text-pulse 1.5s ease-in-out infinite; text-shadow: none; margin-bottom: 25px; }
@keyframes text-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.loader-progress-container { width: 200px; height: 8px; background-color: rgba(255, 255, 255, 0.2); border-radius: 4px; overflow: hidden; margin-bottom: 15px; }
.loader-progress-bar { width: 0%; height: 100%; background-color: #ffffff; border-radius: 4px; transition: width 0.3s ease; }
.loader-progress-text { color: #ffffff; font-size: 14px; letter-spacing: 1px; margin-top: 0; opacity: 1; line-height: 1.5; text-align: center; width: 200px; }

/* 分页 PC/手机 兼容 */
@media (min-width: 769px) {
    .pagination .total-count { display: inline-block !important; }
    .pagination .jump-page-container { display: flex !important; align-items: center; gap: 8px; }
}

/* 手机端源码详情页优化 */
@media (max-width: 768px) {
    /* 全局容器宽度（控制整个详情页） */
    .container { 
        padding: 20px 0 !important; 
        box-sizing: border-box !important; 
        width: 90% !important; /* 核心：修改这里的数值控制宽度，比如 100% 是全屏 */
        max-width: 100% !important; /* 新增：防止宽度超出屏幕 */
        margin: 10px auto !important; /* 新增：保证居中，上下间距更合理 */
    }
    /* 详情页标题样式 */
    .container h1 { 
        font-size: 20px !important; 
        margin: 15px 0 10px !important; 
        padding-bottom: 10px !important; 
        letter-spacing: 0.5px !important; 
        margin-top: -30px !important; 
    }
    /* 详情页图片自适应 */
    .container img { 
        max-width: 100% !important; 
        width: 100% !important; 
        height: auto !important; 
    }
    /* 新增：源码介绍/搭建教程区域专属宽度（如果需要单独控制） */
    .source-intro-box, .source-tutorial-box {
        width: 100% !important; /* 继承容器宽度，也可设 90% 缩小 */
        padding: 10px !important; /* 减少内边距，适配手机 */
        margin: 10px auto !important; /* 居中 */
        box-sizing: border-box !important;
    }
    
    /* 只针对源码介绍/搭建教程的白色背景块，不影响其他区域 */
    div[style*="background: #fff; padding: 25px; border-radius: 8px;"] {
        width: calc(100% + 40px) !important; /* 比外层容器宽40px（左右各多20px） */
        margin-left: -20px !important; /* 向左偏移20px，抵消宽度增加的部分，居中显示 */
        margin-right: -20px !important; /* 向右偏移20px */
        padding: 15px !important;
        box-sizing: border-box !important;
        position: relative !important; /* 必须加，负边距才生效 */
    }
    
    /* 顺带优化背景块内的图片，适配加宽后的区域 */
    div[style*="background: #fff; padding: 25px; border-radius: 8px;"] img {
        max-width: 100% !important;
        width: 100% !important;
    }

/* 只把下载按钮改小（固定像素，简单直观） */
    .download-btn {
        width: auto !important; /* 宽度自适应（不占满屏幕） */
        padding: 10px 18px !important; /* 上下6px、左右18px（核心：改小内边距=按钮变小） */
        font-size: 15px !important; /* 文字改小（默认16px→13px） */
        border-radius: 6px !important; /* 圆角同步改小，更协调 */
        margin: 0 auto !important; /* 保持按钮居中 */
    }

}
.container a[onclick*="safeNav(event, '?mod=source', 'menu')"] { cursor: pointer; transition: all 0.2s ease; }
.container a[onclick*="safeNav(event, '?mod=source', 'menu')"]:hover { background-color: #007bff !important; color: #fff !important; text-decoration: none !important; }

/* 新增：确保中间区域子容器无额外边距，兜底对齐 */
.container .cat-parent,
.container .cat-child,
.container .grid {
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    box-sizing: border-box;
}
/* 移动端子容器额外适配 */
@media (max-width: 768px) {
    .container .cat-parent,
    .container .cat-child,
    .container .grid {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* ================= 极致丝滑的顶部页面加载进度条 (类似 YouTube/GitHub) ================= */
#top-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px; /* 进度条高度 */
    background: #1890ff; /* 进度条颜色，和你的主题色一致 */
    z-index: 99999999;
    transition: width 0.2s ease, opacity 0.4s ease;
    width: 0%;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 10px #1890ff, 0 0 5px #1890ff; /* 发光效果 */
}

/* 直接通过onclick中的svip_item定位链接，无需class */
.nav-item a[onclick*="svip_item"] {
    color: red !important;
    font-weight: bold !important;
    display: inline-block !important;
    transition: transform 0.2s ease !important;
    transform-origin: center !important;
}
.nav-item a[onclick*="svip_item"]:hover {
    transform: scale(1.1) !important;
    color: #dc3545 !important;
}

/* 全局消除链接默认样式，避免URL提示相关的视觉特征 */
a {
    text-decoration: none !important;
    cursor: pointer !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* 分类/菜单/LOGO/首页链接专属样式：彻底消除URL提示相关特征 */
.nav-link, .cat-link, .page-link, .nav-logo, .home-link {
    pointer-events: auto !important;
    user-select: none !important;
}

/* 针对nav-logo的专属样式，彻底屏蔽URL提示（PC端保留） */
.nav-logo {
    display: inline-block;
    text-decoration: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
    /* 禁用浏览器默认的状态栏提示 */
    pointer-events: auto;
}

/* 移动端（屏幕宽度≤767px）隐藏nav-logo */
@media (max-width: 767px) {
    .nav-logo {
        display: none !important; /* 彻底隐藏 */
        visibility: hidden !important; /* 双重保障，防止部分场景显示 */
        width: 0 !important;
        height: 0 !important;
        opacity: 0 !important;
    }
}

/* 禁用状态栏提示（部分浏览器支持） */
body {
    pointer-events: auto;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

/* 禁用所有元素的焦点框，防止点击后出现焦点导致的滚动/提示 */
*:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* 彻底隐藏所有链接的URL提示伪元素 */
a::after, .nav-logo::after, .home-link::after {
    display: none !important;
    content: "" !important;
}

/* 只修复 PC 端右上角两个标签并排不重叠 */
@media (min-width: 769px) {
  /* 新标签：靠右 */
  .tag-new {
    position: absolute !important;
    top: 0.4vw !important;
    right: 0.4vw !important;
  }
  /* 收藏标签：放在新标签左边 */
  .tag-collect {
    position: absolute !important;
    top: 0.4vw !important;
    right: calc(0.4vw + 1.9vw) !important;
  }
}