/* Homepage portal layout (源码网风格) */

.page-home {
    background: #f0f2f5;
}

.page-home .site-main {
    padding-top: 0;
}

/* Hero 3-column */
.home-portal-page {
    padding-bottom: 24px;
}

.home-hero-section {
    padding: 16px 0;
}

.home-hero-grid {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 240px;
    gap: 12px;
    align-items: stretch;
}

.card-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

.home-cat-sidebar {
    overflow: hidden;
}

.home-cat-head {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
}

.home-cat-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.home-cat-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 0.86rem;
    color: #334155;
    transition: background 0.15s;
}

.home-cat-list li a:hover {
    background: #eff6ff;
    color: #2563eb;
}

.home-cat-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.home-cat-empty,
.home-notice-empty {
    padding: 16px 14px;
    color: #94a3b8;
    font-size: 0.84rem;
}

.home-hero-center {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.home-hero-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Portal carousel */
.home-portal-carousel {
    position: relative;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 4px;
    background: #0f172a;
}

.home-portal-carousel .portal-carousel-track,
.home-portal-carousel .carousel-track {
    aspect-ratio: 16 / 7;
    min-height: 220px;
    max-height: 340px;
    border-radius: 4px;
}

.home-portal-carousel .carousel-link img,
.home-portal-carousel .portal-carousel-link img {
    object-fit: cover;
}

.home-portal-carousel .portal-carousel-btn,
.home-portal-carousel .carousel-btn {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    opacity: 0;
}

.home-portal-carousel:hover .portal-carousel-btn,
.home-portal-carousel:hover .carousel-btn {
    opacity: 1;
}

.home-portal-carousel .portal-carousel-dots,
.home-portal-carousel .carousel-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 2;
}

.home-portal-carousel .portal-carousel-dot,
.home-portal-carousel .carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

.home-portal-carousel .portal-carousel-dot.active,
.home-portal-carousel .carousel-dot.active {
    background: #fff;
    width: 20px;
    border-radius: 999px;
}

/* Activity ticker */
.home-activity-ticker {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    overflow: hidden;
}

.home-activity-label {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 3px;
    background: #fef3c7;
    color: #b45309;
    font-size: 0.75rem;
    font-weight: 700;
}

.home-activity-scroll {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.home-activity-track {
    display: flex;
    gap: 32px;
    white-space: nowrap;
    will-change: transform;
}

.home-activity-item {
    font-size: 0.8rem;
    color: #64748b;
}

.home-activity-item strong {
    color: #334155;
    font-weight: 600;
}

/* Notice sidebar */
.home-notice-sidebar {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.home-notice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.home-notice-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #dc2626;
}

.home-notice-more {
    font-size: 0.78rem;
    color: #94a3b8;
}

.home-notice-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    flex: 1;
    overflow: auto;
}

.home-notice-list li a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 14px;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.45;
}

.home-notice-list li a:hover {
    background: #f8fafc;
    color: #2563eb;
}

.home-notice-list em {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    background: #f1f5f9;
    color: #64748b;
    font-style: normal;
    font-size: 0.72rem;
    line-height: 18px;
    text-align: center;
}

.home-notice-list span {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Resource blocks */
.home-block-section {
    padding: 18px 0;
}

.home-block-alt {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.home-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2563eb;
}

.home-block-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.home-block-icon {
    font-size: 1.1rem;
}

.home-block-more {
    font-size: 0.82rem;
    color: #94a3b8;
}

.home-block-more:hover {
    color: #2563eb;
}

/* Resource grid 4 columns */
.portal-res-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.portal-res-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.portal-res-card:hover {
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.portal-res-cover {
    aspect-ratio: 1;
    background: #f8fafc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-res-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.portal-res-card:hover .portal-res-cover img {
    transform: scale(1.05);
}

.portal-res-fallback {
    font-size: 2rem;
    opacity: 0.35;
}

.portal-res-body {
    padding: 10px 10px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.portal-res-title {
    margin: 0 0 6px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.45;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.portal-res-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 0.72rem;
}

.portal-res-cat {
    color: #2563eb;
}

.portal-res-date {
    color: #94a3b8;
    white-space: nowrap;
}

.portal-res-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
}

.portal-res-price {
    font-size: 0.78rem;
    font-weight: 700;
}

.portal-res-price.is-free {
    color: #16a34a;
}

.portal-res-price.is-vip {
    color: #dc2626;
}

.portal-res-price.is-paid {
    color: #ea580c;
}

.portal-res-action {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* News section */
.home-news-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 32px;
}

.home-news-col {
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-news-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.86rem;
}

.home-news-link:hover .home-news-title {
    color: #2563eb;
}

.home-news-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #334155;
}

.home-news-link time {
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 0.78rem;
}

/* Legal strip */
.home-legal-strip {
    margin-top: 8px;
    padding: 14px 0;
    background: #fff7ed;
    border-top: 1px solid #fed7aa;
}

.home-legal-strip p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.7;
    color: #9a3412;
    text-align: center;
}

/* Responsive */
@media (max-width: 1200px) {
    .portal-res-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-hero-grid {
        grid-template-columns: 180px minmax(0, 1fr) 220px;
    }
}

@media (max-width: 992px) {
    .portal-res-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-hero-grid {
        grid-template-columns: 1fr;
    }

    .home-cat-sidebar {
        order: 2;
    }

    .home-hero-center {
        order: 1;
    }

    .home-notice-sidebar {
        order: 3;
    }

    .home-cat-list {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .home-portal-page {
        padding-top: 8px;
    }

    .portal-res-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .home-news-grid {
        grid-template-columns: 1fr;
    }

    .home-cat-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .portal-res-grid {
        grid-template-columns: 1fr;
    }
}
