/* Homepage utility and layout styles extracted from index.html. */
.scrollbar-hide {
        -ms-overflow-style: none;
    }
    .scrollbar-hide::-webkit-scrollbar {
        display: none;
    }
    .nav-active {
        color: var(--tw-colors-primary, #1e80ff);
        font-weight: bold;
        border-bottom: 2px solid var(--tw-colors-primary, #1e80ff);
    }
    .number-1 { background-color: var(--tw-colors-danger, #ff4d4f); }
    .number-2 { background-color: var(--tw-colors-warning, #ff7d00); }
    .number-3 { background-color: var(--tw-colors-secondary, #ff7a45); }
    .number-default {
        background-color: #8c8c8c;
        color: #ffffff;
    }
    .fade-in {
        animation: fadeIn 0.5s ease-in-out;
    }
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

/* Homepage overrides for the news index template. */
body {
        background-color: #f2f2f6;
        color: #333;
        font-size: 14px;
        line-height: 1.4;
        overflow-x: hidden;
    }
    .headBg {
        display: none;
    }
    #app {
        width: 100%;
        max-width: 1360px;
        margin: 0 auto;
        padding: 0 24px 32px;
        overflow-x: hidden;
    }
    .common-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        pointer-events: auto;
    }
    .common-header .el-overlay,
    .common-header .el-dialog__wrapper,
    .common-header .el-dialog,
    .common-header .el-drawer,
    .common-header .layerBox,
    .common-header .drawer {
        pointer-events: auto;
    }
    .el-overlay,
    .el-dialog,
    .el-dialog__body,
    .el-dialog__header,
    .el-dialog__footer,
    .el-input,
    .el-input__wrapper,
    .el-textarea,
    .el-textarea__inner,
    .layerBox,
    .drawer,
    .menu-dialog-wrapper {
        pointer-events: auto !important;
    }
    .common-header .headerBox {
        position: static !important;
        height: 0 !important;
        background: transparent !important;
        border-bottom: 0 !important;
        pointer-events: none;
    }
    .common-header .headerKox {
        height: 0 !important;
    }
    .common-header .headerBox .bg {
        display: none !important;
    }
    .common-header .headerBox .box {
        width: 100%;
        max-width: 1360px;
        height: auto;
        padding: 20px 16px 0;
        justify-content: flex-end;
        overflow: visible !important;
        pointer-events: none;
    }
    .common-header .headerBox .box > .logoBox,
    .common-header .headerBox .box > .search,
    .common-header .headerBox .box .navs .btns {
        display: none !important;
    }
    .common-header .headerBox .box .navs {
        pointer-events: auto;
    }
    .common-header .headerBox .box .navs .iconfont {
        display: none !important;
    }
    .common-header .headerBox .box .navs .item {
        position: fixed;
        right: 24px;
        bottom: 86px;
        z-index: 120;
        pointer-events: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin-left: 8px;
        padding: 0;
        border: 1px solid rgba(220,223,230,.8);
        border-radius: 12px;
        background: rgba(255,255,255,.96);
        color: #64748b;
        font-size: 0;
        line-height: 1.2;
        box-shadow: 0 8px 18px rgba(31,45,61,.10);
        backdrop-filter: blur(8px);
    }
    .common-header .headerBox .box .navs a {
        display: none !important;
    }
    .common-header .headerBox .box .navs .item::before {
        content: "+";
        font-size: 20px;
        line-height: 1;
        font-weight: 300;
    }
    .global-backtop {
        display: none !important;
    }
    .common-footer,
    .footerBox,
    .footerBox .box {
        text-align: center !important;
    }
    .footerBox {
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .footerBox .box {
        width: 100% !important;
        max-width: 1360px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        overflow: visible !important;
    }
    .footerBox .box p {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
    }
    .footerBox .box a {
        display: inline-block !important;
        text-align: center !important;
    }
    .home-hero {
        width: 100%;
        max-width: 1240px;
        margin: 0 auto;
        padding: 64px 0 18px;
    }
    .search-container {
        margin: 0 auto;
        max-width: 740px;
        padding: 0;
    }
    .search-container .flex {
        height: 46px;
        align-items: center;
        padding: 0 4px 0 16px;
        border: 1px solid #e5e5e5;
        border-radius: 10px;
        background: #fff;
        box-shadow: none;
        transition: border-color .2s ease, box-shadow .2s ease;
    }
    .search-container .flex:focus-within {
        border-color: #0052d9;
        box-shadow: 0 0 0 3px rgba(0,82,217,0.06);
    }
    .search-input {
        height: 100%;
        border-radius: 0;
        border: none;
        padding: 0;
        width: 100%;
        outline: none;
        color: #333;
        font-size: 15px;
        box-shadow: none;
        background: transparent;
    }
    .search-button {
        min-width: 40px;
        width: 40px;
        height: 38px;
        border-radius: 8px;
        background-color: #0052d9;
        color: white;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: row;
        white-space: nowrap;
        border: none;
        cursor: pointer;
    }
    .search-button i {
        margin-right: 0 !important;
        font-size: 18px;
    }
    .home-hero .logo {
        width: auto;
        height: 64px;
        margin-bottom: 16px;
    }
    .resource-item:hover {
        background-color: #fafafc;
    }
    .main-title {
        font-size: 24px;
        line-height: 1.25;
        font-weight: 800;
        color: #1a1a1a;
        margin-bottom: 6px;
    }
    .sub-title {
        font-size: 14px;
        color: #999;
        margin-bottom: 20px;
    }
    .nav-item {
        cursor: pointer;
        padding: 14px 2px !important;
        border: 0 !important;
        border-bottom: 2px solid transparent !important;
        border-radius: 0;
        background: transparent;
        color: #666;
        font-size: 15px;
        line-height: 1.4;
        margin-bottom: -1px;
        user-select: none;
        transition: color .2s ease, border-color .2s ease;
    }
    .nav-item.nav-active {
        color: #0052d9 !important;
        font-weight: 600;
        border-bottom-color: #0052d9 !important;
    }
    .nav-item:hover {
        color: #333;
    }
    .nav-content-container {
        margin-top: 20px;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        border: 1px solid #f0f0f0;
        border-radius: 12px;
        box-shadow: none;
    }
    .nav-content-container .nav {
        padding: 0 14px;
        border-bottom-color: #f5f5f5;
    }
    .nav-content-container .content {
        padding: 12px 14px 8px;
    }
    .home-card-head {
        margin-bottom: 10px;
    }
    .home-card-title {
        position: relative;
        padding-left: 0;
        font-size: 16px;
        font-weight: 700;
        color: #1a1a1a;
    }
    .home-card-title::before {
        display: none;
    }
    .home-card-count {
        color: #999;
        font-size: 13px;
    }
    .resource-item {
        min-height: 43px;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        border-bottom-color: #f5f5f5 !important;
    }
    .resource-item .number {
        flex-shrink: 0;
        width: 22px;
        height: 22px;
        margin-right: 10px;
        font-size: 12px;
    }
    .resource-item .date {
        margin-left: 12px;
        flex-shrink: 0;
    }
    .resource-item a {
        color: #333;
        text-decoration: none;
        font-size: 14px;
    }
    .resource-item a:hover {
        color: #1e80ff;
    }
    /* 有图模式宫格布局样式 */
    .image-mode-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
        padding: 0;
        list-style: none;
    }
    
    @media (max-width: 768px) {
        .image-mode-grid {
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 12px;
        }
    }
    
    @media (max-width: 480px) {
        .image-mode-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
        }
    }
    
    .resource-item.with-image {
        position: relative;
        background: #fff;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        transition: all 0.3s ease;
        border: 1px solid #f0f0f0;
        margin-bottom: 0;
    }
    
    .resource-item.with-image:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.15);
        border-color: #1e80ff;
    }
    
    .resource-image-container {
        position: relative;
        width: 100%;
        height: 240px; /* 调整为更接近2:3宽高比 */
        overflow: hidden;
        border-radius: 12px 12px 0 0;
    }
    
    @media (max-width: 768px) {
        .resource-image-container {
            height: 220px; /* 中等屏幕适配 */
        }
    }
    
    @media (max-width: 480px) {
        .resource-image-container {
            height: 180px; /* 小屏幕保持合适比例 */
        }
    }
    
    .resource-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
    }
    
    .resource-content {
        padding: 12px;
        background: #fff;
        border-radius: 0 0 12px 12px;
    }
    
    .resource-title {
        font-size: 14px;
        line-height: 1.4;
        font-weight: 600;
        color: #333;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 4px; /* 减小标题和排名之间的间距 */
        min-height: 38px;
    }
    
    @media (max-width: 480px) {
        .resource-title {
            font-size: 13px;
            min-height: 34px;
        }
    }
    
    .resource-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .hot-score {
        font-size: 12px;
        color: #ff4d4f;
        font-weight: 600;
        background: rgba(255, 77, 79, 0.1);
        padding: 2px 6px;
        border-radius: 4px;
    }
    
    .resource-ranking {
        font-size: 12px;
        color: #999;
        font-weight: 500;
    }
    
    .resource-number {
        position: absolute;
        top: 8px;
        left: 8px;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: bold;
        color: white;
        z-index: 3;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    
    /* 整个卡片链接样式 */
    .resource-card-link {
        display: block;
        text-decoration: none;
        color: inherit;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        border-radius: 12px;
        overflow: hidden;
    }
    
    .resource-card-link:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        text-decoration: none;
        color: inherit;
    }
    
    .resource-card-link:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }
    
    /* 搜索联想框样式 */
    .search-suggestions {
        position: absolute;
        top: calc(100% + 8px);
        left: 26px;
        right: 26px;
        background: white;
        border: 1px solid #eef2f7;
        border-radius: 12px;
        box-shadow: 0 10px 24px rgba(15,23,42,0.1);
        z-index: 1000;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .suggestion-item {
        padding: 10px 14px;
        cursor: pointer;
        transition: background-color 0.2s;
        border-bottom: 1px solid #f5f7fb;
        color: #1f2937;
        font-size: 14px;
        line-height: 1.45;
    }
    
    .suggestion-item:last-child {
        border-bottom: none;
    }
    
    .suggestion-item:hover {
        background-color: #f5f7fa;
    }
    
    .suggestion-highlight {
        color: var(--tw-colors-primary, #1e80ff);
        font-weight: bold;
    }
    
    /* 骨架屏样式 */
    .skeleton-loader {
        padding: 12px 14px;
    }
    
    .skeleton-item {
        height: 14px;
        background: #f0f2f5;
        margin-bottom: 10px;
        border-radius: 4px;
        animation: pulse 1.5s infinite;
    }
    
    @keyframes pulse {
        0% { opacity: 0.6; }
        50% { opacity: 1; }
        100% { opacity: 0.6; }
    }
    @media (max-width: 768px) {
        html,
        body {
            width: 100%;
            overflow-x: hidden;
            background: #f4f6f9;
        }

        #app {
            width: 100%;
            max-width: none;
            padding: 0 0 32px;
            background: #f4f6f9;
        }
        .common-header .headerBox .box {
            max-width: none;
            padding: 18px 20px 0;
        }
        .common-header .headerBox .box .navs .item,
        .common-header .headerBox .box .navs a,
        .common-header .headerBox .box .navs .btns {
            display: none !important;
        }
        .common-header .headerBox .box .navs .iconfont.header-menu-btn {
            position: fixed;
            top: 18px;
            right: 20px;
            z-index: 130;
            pointer-events: auto;
            display: flex !important;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border: 1px solid rgba(220,223,230,.85);
            border-radius: 10px;
            background: rgba(255,255,255,.95);
            color: #3f3f46;
            font-size: 21px;
            box-shadow: 0 6px 16px rgba(31,45,61,.08);
        }
        .common-header .headerBox .box .navs .item {
            display: none !important;
        }
        .home-hero {
            width: min(100%, 520px);
            max-width: none;
            padding: 76px 26px 30px;
            margin: 0 auto;
        }
        .home-hero .logo {
            height: 48px;
            margin-bottom: 18px;
        }
        .main-title {
            font-size: clamp(28px, 7vw, 34px);
            line-height: 1.18;
            margin-bottom: 8px;
            font-weight: 800;
        }
        .sub-title {
            max-width: 360px;
            margin: 0 auto;
            color: #64748b;
            font-size: 16px;
            line-height: 1.45;
        }
        .search-container {
            width: min(100%, 520px);
            max-width: none;
            margin: 0 auto;
            padding: 0 26px;
        }
        .search-container .flex {
            height: 56px;
            padding: 0 0 0 20px;
            border: 0;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 8px 22px rgba(15, 23, 42, .10);
        }
        .search-input {
            min-width: 0;
            font-size: 17px;
        }
        .search-button {
            min-width: 62px;
            width: 62px;
            height: 56px;
            border-radius: 0;
            padding: 0;
        }
        .search-button i {
            font-size: 22px;
        }
        .nav-content-container {
            width: min(calc(100% - 52px), 468px);
            margin: 38px auto 0;
            border: 0;
            border-radius: 16px;
            box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
        }
        .nav-content-container .nav {
            padding: 0 20px;
            border-bottom-color: #eef2f7;
        }
        .nav-content-container .content {
            padding: 20px 20px 20px;
        }
        .nav-item {
            flex: 1 1 0;
            min-width: 0;
            padding: 18px 0 15px !important;
            color: #4b5563 !important;
            font-size: 16px;
            font-weight: 500;
            text-align: center;
            white-space: nowrap;
        }
        .nav-item.nav-active {
            color: #0052d9 !important;
            font-weight: 700;
        }
        .nav-content-container .nav ul {
            width: 100%;
            gap: 0;
            justify-content: space-between;
            overflow: visible;
        }
        .home-card-head {
            margin-bottom: 14px;
        }
        .home-card-title {
            font-size: 20px;
            font-weight: 800;
        }
        .home-card-count {
            font-size: 15px;
            color: #94a3b8;
        }
        .resource-item {
            min-height: 58px;
            padding: 10px 0 !important;
        }
        .resource-item .number {
            width: 32px;
            height: 32px;
            margin-right: 15px;
            font-size: 18px;
            font-weight: 800;
        }
        .resource-item a {
            min-width: 0;
            color: #111827;
            font-size: 17px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .resource-item .date {
            width: 34px;
            min-width: 34px;
            height: 30px;
            margin-left: 12px;
            padding: 0;
            border-radius: 8px;
            color: #9aa3af;
            background: #f1f6ff;
            font-size: 12px;
            line-height: 30px;
            text-align: center;
        }
        .common-footer {
            margin-top: 58px !important;
        }
        .common-footer .text-center {
            padding-top: 0 !important;
            padding-bottom: 34px !important;
            color: #8a8f98;
            font-size: 15px;
        }
        .footerBox {
            padding: 0 18px 34px !important;
        }
        .footerBox .box {
            color: #777;
            font-size: 15px;
            line-height: 1.7;
        }
        .footerBox .box p {
            margin-bottom: 22px;
        }
        .footerBox .box a {
            margin-top: 8px;
            font-size: 15px;
        }
    }

    @media (max-width: 390px) {
        .home-hero,
        .search-container {
            padding-left: 20px;
            padding-right: 20px;
        }

        .nav-content-container {
            width: calc(100% - 40px);
        }

        .nav-content-container .nav,
        .nav-content-container .content {
            padding-left: 18px;
            padding-right: 18px;
        }

        .nav-item {
            font-size: 15px;
        }

        .resource-item a {
            font-size: 16px;
        }
    }

    @media (max-width: 340px) {
        .home-hero,
        .search-container {
            padding-left: 16px;
            padding-right: 16px;
        }

        .nav-content-container {
            width: calc(100% - 32px);
        }

        .search-container .flex {
            height: 52px;
        }

        .search-input {
            font-size: 15px;
        }

        .search-button {
            width: 56px;
            min-width: 56px;
            height: 52px;
        }

        .nav-content-container .nav,
        .nav-content-container .content {
            padding-left: 16px;
            padding-right: 16px;
        }

        .nav-item {
            font-size: 14px;
        }

        .resource-item .number {
            width: 30px;
            height: 30px;
            margin-right: 12px;
            font-size: 17px;
        }
    }

/* 首页轻量工具类：替代运行时 Tailwind，避免首屏加载外部 CDN。 */
.relative { position: relative; }
.text-center { text-align: center; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.text-ellipsis { text-overflow: ellipsis; }
.whitespace-nowrap { white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.transition-colors { transition: color .2s ease, border-color .2s ease, background-color .2s ease; }
.bg-white { background: #fff; }
.border-b { border-bottom: 1px solid #f0f0f0; }
.border-gray-3 { border-color: #eef2f7; }
.text-gray-2 { color: #94a3b8; }
.text-white { color: #fff; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 14px; }
.w-6 { width: 24px; }
.h-6 { height: 24px; }
.rounded-full { border-radius: 999px; }
.flex-1 { flex: 1 1 0%; }
.mr-3 { margin-right: 12px; }
.mt-10 { margin-top: 40px; }
.p-4 { padding: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.gap-2 { gap: 8px; }
.scrollbar-hide { scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.hover\:text-primary:hover { color: #0052d9; }
.bg-primary\/10 { background: rgba(0, 82, 217, .08); }
