/* ========== 首页专用样式 ========== */

.home-header {
    margin-bottom: 20px;
}

.home-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #091d2e;
    margin: 0 0 4px;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

.home-header p {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}

/* ========== 首页底部备案信息 ========== */
.footer-content {
    margin-top: 24px;
    padding: 16px 0 8px;
    border-top: 1px solid #e8edf3;
}

.footer-text {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.8;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.footer-link {
    color: #409eff;
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

.footer-company-link {
    cursor: pointer;
}

.footer-content img {
    vertical-align: middle;
    display: inline-block;
}

.footer-analytics {
    display: inline-flex;
    align-items: center;
}

.home-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin-bottom: 20px;
    min-width: 0;
}

.home-filter-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    margin-right: 2px;
    flex-shrink: 0;
}

.home-filter-tags {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.home-filter-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 12px;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.home-filter-tag:hover,
.home-filter-tag.active {
    background: #409eff;
    color: #fff;
}

.home-filter-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    text-decoration: none;
    background: #fff;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
    line-height: 1;
}

.home-filter-refresh:hover {
    border-color: #409eff;
    color: #409eff;
}

.home-category-row {
    display: flex;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e8edf3;
}

.home-category-tabs {
    display: flex;
    align-items: flex-end;
    gap: 0;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.home-search-form {
    display: flex;
    align-items: center;
    align-self: center;
    flex-shrink: 0;
    width: 320px;
    max-width: 100%;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-search-form:focus-within {
    border-color: #409eff;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.12);
}

.home-search-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    padding: 0 12px;
    font-size: 13px;
    color: #334155;
    background: transparent;
}

.home-search-input::placeholder {
    color: #94a3b8;
}

.home-search-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: #409eff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.home-search-btn:hover {
    background: #337ecc;
}

.home-search-btn img {
    filter: brightness(0) invert(1);
}

.home-category-tabs::-webkit-scrollbar {
    display: none;
}

.home-tab {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 13px;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s ease;
    cursor: pointer;
    line-height: 1.4;
}

.home-tab:hover,
.home-tab.active {
    color: #409eff;
}

.home-tab.active {
    font-weight: 600;
}

.home-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10px;
    right: 10px;
    height: 2px;
    background: #409eff;
    border-radius: 1px;
}

.home-tab-count {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 3px;
    font-weight: 400;
}

.home-tab.active .home-tab-count {
    color: #409eff;
}

.section:has(.home-grid-wrap) {
    margin-bottom: 24px;
}

.section:has(.home-grid-wrap) > h2 {
    font-size: 18px;
    margin-bottom: 14px;
    color: #091d2e;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.home-grid-wrap {
    position: relative;
}

.home-panorama-grid {
    column-count: 2;
    column-gap: 14px;
}

.home-panorama-grid.is-preloading .home-work-item {
    visibility: hidden;
}

.home-grid-loader {
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    pointer-events: none;
}

.home-grid-loader.is-visible {
    display: flex;
}

.home-grid-loader.is-preload {
    position: absolute;
    inset: 0;
    min-height: 140px;
}

.home-grid-loader.is-append {
    position: static;
    padding: 24px 0 8px;
    min-height: auto;
}

.home-work-item {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
    vertical-align: top;
    margin-bottom: 16px;
}

.home-work-card {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px -4px rgba(54, 163, 247, 0.12);
    contain: layout style;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    background: #f1f5f9;
}

@media (hover: hover) {
    .home-work-item:hover .home-work-card {
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    }

    .home-work-item:hover .home-work-media-link {
        transform: scale(1.02);
    }
}

.home-work-item.is-panorama .home-work-media {
    aspect-ratio: 1 / 1;
}

.home-work-media {
    position: relative;
    width: 100%;
    aspect-ratio: var(--card-aspect, 4 / 3);
    overflow: hidden;
    background: #f1f5f9;
    line-height: 0;
}

.home-work-item:not(.is-panorama) .home-work-media {
    max-height: 480px;
}

.home-work-item:not(.is-panorama) .home-work-thumb {
    max-height: 480px;
}

.home-work-media-link {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    transform: scale(1);
    transition: transform 0.25s ease;
    will-change: transform;
}

.home-work-thumb {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 0.28s ease;
    background: #f1f5f9;
}

.home-work-thumb.is-loaded,
.home-work-thumb:not([data-src]) {
    opacity: 1;
}

.home-work-media .index-vricon {
    z-index: 8;
    background: rgba(0, 0, 0, 0.42);
    border-radius: 6px 0;
    justify-content: center;
    align-items: center;
    gap: 3px;
    max-width: 80%;
    height: 24px;
    padding: 0 8px;
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
}

.home-work-media .index-vricon-icon {
    width: 14px;
    height: 14px;
    display: block;
    flex-shrink: 0;
}

.home-work-media .index-vricon span {
    color: #f3d790;
    font-size: 11px;
    line-height: 1;
    font-weight: 500;
    white-space: nowrap;
}

.home-work-fav {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.48);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.home-work-fav-icon {
    width: 16px;
    height: 16px;
    display: block;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.home-work-item:hover .home-work-fav,
.home-work-fav.is-favorited {
    opacity: 1;
    transform: translateY(0);
}

.home-work-fav:hover {
    background: rgba(0, 0, 0, 0.62);
}

.home-work-fav.is-favorited .home-work-fav-icon {
    filter: drop-shadow(0 0 4px rgba(255, 195, 18, 0.5));
    transform: scale(1.08);
}

.home-work-fav.is-favorited:hover .home-work-fav-icon {
    filter: drop-shadow(0 0 6px rgba(255, 195, 18, 0.65));
    transform: scale(1.12);
}

.home-work-meta {
    margin: 5px 0 0;
    padding: 0 2px;
    font-size: 13px;
    line-height: 1.45;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.home-work-author,
.home-work-author.is-static,
.home-work-title {
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
}

.home-work-sep {
    color: #94a3b8;
    font-weight: 400;
}

.home-work-title:hover {
    color: #409eff;
}

.home-grid-empty {
    column-span: all;
    display: block;
    width: 100%;
    text-align: center;
    color: #94a3b8;
    padding: 36px 0;
    font-size: 13px;
}

.home-load-status {
    margin-top: 6px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .home-panorama-grid {
        column-count: 3;
        column-gap: 16px;
    }

    .home-work-item {
        margin-bottom: 18px;
    }
}

@media (min-width: 1024px) {
    .home-panorama-grid {
        column-count: 4;
        column-gap: 18px;
    }
}

@media (min-width: 1200px) {
    .home-panorama-grid {
        column-count: 5;
        column-gap: 20px;
    }

    .home-work-item {
        margin-bottom: 20px;
    }

    /* 全景卡片高度一致时，列内错落偏移，避免顶边齐平 */
    .home-work-item.is-panorama:nth-child(5n+2),
    .home-work-item.is-panorama:nth-child(5n+4) {
        margin-top: 16px;
    }

    .home-work-item.is-panorama:nth-child(5n+3) {
        margin-top: 8px;
    }
}

@media (max-width: 767px) {
    .home-header h2 {
        font-size: 20px;
    }

    .home-header p {
        font-size: 12px;
    }

    .home-category-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-bottom: 10px;
    }

    .home-search-form {
        width: 100%;
        margin-bottom: 0;
    }

    .home-tab {
        padding: 9px 12px;
        font-size: 12px;
    }

    .home-filter-bar {
        margin-bottom: 16px;
    }

    .home-work-item {
        margin-bottom: 14px;
    }

    .home-work-meta {
        font-size: 12px;
    }
}
