/* 产品首页 — 信息流布局（参考社区类产品） */

:root {
    --home-brand: #07c160;
    --home-brand-hover: #06ad56;
    --home-text: #0f172a;
    --home-text-secondary: #64748b;
    --home-border: rgba(15, 23, 42, 0.08);
    --home-sidebar-w: 15.5rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.home-app {
    margin: 0;
    min-height: 100vh;
    font-family: "PingFang SC", "Microsoft YaHei", "Inter", sans-serif;
    color: var(--home-text);
    background: #fff;
}

.home-layout {
    display: flex;
    min-height: 100vh;
}

/* —— 左侧导航 —— */
.home-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--home-sidebar-w);
    padding: 1.25rem 0.75rem 1rem;
    border-right: 1px solid var(--home-border);
    background: #fff;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.home-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.25rem 0.5rem 1.25rem;
    text-decoration: none;
    color: var(--home-text);
}

.home-logo img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    object-fit: cover;
}

.home-logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.home-logo-sub {
    display: block;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--home-text-secondary);
    line-height: 1.35;
    max-width: 9rem;
}

.home-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.home-nav-item {
    margin-bottom: 0.25rem;
}

.home-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--home-text);
    text-decoration: none;
    transition: background 0.15s;
}

.home-nav-link i {
    width: 1.25rem;
    text-align: center;
    font-size: 1.05rem;
    color: var(--home-text-secondary);
}

.home-nav-link:hover {
    background: #f8fafc;
}

.home-nav-link.is-active {
    background: #f1f5f9;
    font-weight: 600;
}

.home-nav-link.is-active i {
    color: var(--home-brand);
}

.home-nav-badge {
    margin-left: auto;
    padding: 0.1rem 0.4rem;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 0.25rem;
    background: linear-gradient(135deg, #34d399, var(--home-brand));
    color: #fff;
}

.home-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.5rem 0.35rem 0;
}

.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}

.home-btn--primary {
    background: var(--home-brand);
    color: #fff;
}

.home-btn--primary:hover {
    background: var(--home-brand-hover);
}

.home-btn--ghost {
    background: #f1f5f9;
    color: var(--home-text);
}

.home-btn--ghost:hover {
    background: #e2e8f0;
}

.home-sidebar-beian {
    margin-top: auto;
    padding: 1rem 0.5rem 0.25rem;
    font-size: 0.6875rem;
    color: #94a3b8;
    line-height: 1.4;
    text-align: center;
}

.home-sidebar-beian a {
    color: inherit;
    text-decoration: none;
}

.home-sidebar-beian a:hover {
    color: var(--home-brand);
}

/* —— 主内容 —— */
.home-main {
    flex: 1;
    margin-left: var(--home-sidebar-w);
    min-width: 0;
    padding: 1.25rem 1.5rem 3rem;
}

.home-top {
    max-width: 72rem;
    margin: 0 auto 1.25rem;
}

.home-banner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 1rem;
    padding: 0 0.25rem;
}

.home-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.home-banner-actions .home-btn {
    width: auto;
    padding: 0.55rem 1.15rem;
    font-size: 0.875rem;
}

.home-btn--outline {
    background: #fff;
    color: var(--home-brand);
    border: 1px solid rgba(7, 193, 96, 0.45);
}

.home-btn--outline:hover {
    background: rgba(7, 193, 96, 0.06);
}

.home-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 40rem;
    margin: 0 auto 1.25rem;
    padding: 0.65rem 1rem 0.65rem 1.15rem;
    background: #fff;
    border-radius: 999px;
    border: 1px solid rgba(7, 193, 96, 0.45);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.home-search-wrap:focus-within {
    border-color: var(--home-brand);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.home-search-icon {
    color: #94a3b8;
    font-size: 0.9rem;
}

.home-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    outline: none;
    color: var(--home-text);
}

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

.home-search-ai {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border: none;
    border-radius: 999px;
    background: #fff;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--home-text-secondary);
    white-space: nowrap;
    cursor: pointer;
}

.home-search-ai:hover {
    color: var(--home-primary);
    background: #ecfdf5;
}

.home-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--home-border);
}

.home-tab {
    position: relative;
    display: inline-block;
    padding: 0.5rem 0.15rem;
    border: none;
    background: none;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--home-text-secondary);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.home-tab:hover {
    color: var(--home-text);
}

.home-tab.is-active {
    color: var(--home-text);
    font-weight: 600;
}

.home-tab.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: 1.75rem;
    height: 2px;
    margin-left: -0.875rem;
    background: var(--home-brand);
    border-radius: 2px;
}

/* —— 信息流瀑布流 —— */
.home-feed {
    max-width: 72rem;
    margin: 0 auto;
    column-count: 5;
    column-gap: 1rem;
}

.home-card {
    display: block;
    break-inside: avoid;
    margin-bottom: 1rem;
    border-radius: 0.85rem;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}

.home-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.home-card-media {
    position: relative;
    aspect-ratio: 3 / 4;
    background: #f1f5f9;
    overflow: hidden;
}

.home-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-card-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.2rem 0.45rem;
    border-radius: 0.35rem;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 0.6875rem;
}

.home-card-body {
    padding: 0.65rem 0.7rem 0.75rem;
}

.home-card-title {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--home-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-card-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.home-card-avatar {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.home-card-author {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
    color: var(--home-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-card-like {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: var(--home-text-secondary);
}

.home-card-like i {
    font-size: 0.7rem;
}

.home-feed-status,
.home-empty {
    max-width: 72rem;
    margin: 0 auto;
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--home-text-secondary);
    font-size: 0.875rem;
}

.home-feed-status[hidden],
.home-empty[hidden] {
    display: none;
}

.home-feed-sentinel {
    height: 1px;
    max-width: 72rem;
    margin: 0 auto;
}

/* —— 移动端 —— */
.home-mobile-bar {
    display: none;
}

@media (max-width: 1280px) {
    .home-feed {
        column-count: 4;
    }
}

@media (max-width: 1024px) {
    .home-feed {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .home-sidebar {
        display: none;
    }

    .home-main {
        margin-left: 0;
        padding: 0.75rem 0.75rem 4.5rem;
    }

    .home-banner {
        justify-content: center;
        padding: 0 0.25rem;
    }

    .home-banner-actions {
        justify-content: center;
        width: 100%;
    }

    .home-banner-actions .home-btn {
        flex: 1;
        max-width: 9rem;
    }

    .home-feed {
        column-count: 2;
        column-gap: 0.65rem;
    }

    .home-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 0 1.25rem;
        padding: 0 0.25rem 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    .home-mobile-bar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid var(--home-border);
        z-index: 100;
        gap: 0.5rem;
    }

    .home-mobile-bar .home-btn {
        flex: 1;
        padding: 0.6rem;
        font-size: 0.875rem;
    }
}
