/* 首页：三栏布局、轮播、发帖卡片 */
.homepage-frame {
    width: min(var(--max-width), calc(100% - 24px));
    margin: 0 auto;
}

.homepage-stage {
    padding: 18px 0 56px;
}

.homepage-stage-no-hero {
    padding-top: 16px;
}

.homepage-columns {
    display: grid;
    grid-template-columns: 216px minmax(0, 1fr) 292px;
    gap: 16px;
    align-items: start;
}

.homepage-sidebar-left,
.homepage-sidebar-right,
.homepage-main {
    min-width: 0;
}

.homepage-sidebar-left,
.homepage-sidebar-right {
    display: grid;
    gap: 16px;
}

.home-hero {
    margin-bottom: 16px;
}

.hero-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    box-shadow: var(--shadow-lg);
}

.hero-carousel-track {
    position: relative;
    min-height: 332px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 30px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    background-image: var(--hero-slide-bg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.14) 0%, rgba(15, 23, 42, 0.58) 100%);
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-slide-title {
    position: relative;
    z-index: 1;
    max-width: 560px;
    color: #fff;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.35;
}

.hero-dots {
    position: absolute;
    right: 22px;
    bottom: 22px;
    z-index: 2;
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
    cursor: pointer;
}

.hero-dot.active {
    width: 28px;
    background: #fff;
}

.side-panel {
    padding: 12px;
    border-radius: 12px;
    border-color: #e8ecf3;
    box-shadow: none;
}

.category-nav-panel .panel-title {
    display: none;
}

.category-stack {
    display: grid;
    gap: 8px;
}

.category-stack-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fafbfc;
    border: 1px solid #edf0f5;
    transition: all var(--transition);
}

.category-stack-item strong {
    font-size: 14px;
}

.category-stack-item em {
    display: none;
}

.category-stack-item:hover,
.category-stack-item.active {
    border-color: #dce9ff;
    background: #fff;
    box-shadow: none;
}

.category-stack-item.active strong,
.category-stack-item.active em {
    color: #1677ff;
}

.home-composer-card {
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e8ecf3;
    background: #fff;
    box-shadow: none;
}

.home-composer-form {
    display: grid;
    gap: 16px;
}

.home-composer-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.home-composer-head img,
.active-user-row img,
.topic-meta img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.home-composer-head strong {
    display: block;
    font-size: 16px;
}

.home-composer-head span,
.topic-meta span,
.site-info-copy p,
.active-user-row strong + span {
    color: var(--muted);
}

.home-composer-editor {
    display: grid;
    gap: 12px;
}

.home-composer-title,
.home-composer-content {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.home-composer-title {
    min-height: 46px;
    padding: 0 14px;
    font-size: 14px;
}

.home-composer-content {
    min-height: 120px;
    padding: 12px 14px;
    font-size: 14px;
}

.home-composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.home-composer-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.home-composer-count {
    color: var(--muted);
    font-size: 12px;
}

.home-composer-submit,
.home-composer-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(22, 119, 255, 0.2);
}

.home-composer-category-panel,
.home-composer-topic-panel {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-soft);
}

.home-composer-category-search input,
.home-composer-topic-panel input[type="search"] {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.home-composer-category-list,
.home-composer-topic-list {
    display: grid;
    gap: 10px;
    max-height: 280px;
    overflow: auto;
}

.home-composer-category-option,
.home-composer-topic-option {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition);
}

.home-composer-category-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.home-composer-topic-option {
    display: grid;
    gap: 8px;
}

.home-composer-category-option em,
.home-composer-topic-option p,
.home-composer-topic-meta span,
.home-composer-topic-meta em {
    color: var(--muted);
}

.home-composer-topic-option p {
    margin: 0;
    font-size: 13px;
}

.home-composer-topic-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.home-composer-topic-meta img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.home-composer-category-option.active,
.home-composer-category-option:hover,
.home-composer-topic-option.active,
.home-composer-topic-option:hover {
    border-color: rgba(22, 119, 255, 0.22);
    background: rgba(22, 119, 255, 0.04);
}

.home-composer-guest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.home-composer-guest strong {
    display: block;
    font-size: 18px;
}

.home-composer-guest p {
    margin: 8px 0 0;
    color: var(--muted);
}

.homepage-feed-panel {
    padding: 16px;
    border-radius: 12px;
    border-color: #e8ecf3;
    box-shadow: none;
}

.homepage-toolbar {
    margin-bottom: 12px;
}

.homepage-feed-tabs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 999px;
    background: var(--surface-soft);
}

.homepage-feed-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    color: var(--muted);
}

.homepage-feed-tabs a.active {
    background: #fff;
    color: var(--brand-deep);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.homepage-feed {
    margin-top: 12px;
}

.homepage-feed .post-card {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #edf0f5;
    box-shadow: none;
}

.homepage-feed .post-card-link:hover,
.homepage-feed .post-card-link:focus-visible {
    transform: none;
    border-color: #dce9ff;
    box-shadow: none;
}

.homepage-feed .post-card-layout {
    padding: 14px 16px;
}

.homepage-feed .post-author {
    font-size: 14px;
}

.homepage-feed .post-title {
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.5;
}

.homepage-feed .post-summary {
    font-size: 13px;
    line-height: 1.7;
}

.homepage-feed .post-card-head em,
.homepage-feed .post-stats {
    font-size: 12px;
}

.active-user-list,
.topic-list {
    display: grid;
    gap: 8px;
}

.homepage-sidebar-right .panel-title {
    margin-bottom: 12px;
}

.homepage-sidebar-right .panel-title h2 {
    font-size: 16px;
}

.homepage-sidebar-right .panel-title span {
    font-size: 14px;
}

.active-user-row,
.topic-item {
    display: grid;
    gap: 10px;
    padding: 12px 0;
    border-radius: 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #edf0f5;
    transition: border-color var(--transition), background-color var(--transition);
}

.topic-list > .topic-item:last-child,
.active-user-list > .active-user-row:last-child {
    border-bottom: none;
}

.active-user-row {
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    padding: 8px 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.active-user-row:hover,
.topic-item:hover {
    border-color: #dce9ff;
    background: rgba(22, 119, 255, 0.02);
    box-shadow: none;
    transform: none;
}

.active-users-panel .active-user-row:hover {
    border: none;
    background: transparent;
}

.active-users-panel .active-user-row img {
    width: 32px;
    height: 32px;
}

.active-users-panel .active-user-row strong {
    font-size: 14px;
    font-weight: 400;
}

.topic-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.topic-meta em {
    margin-left: auto;
    font-style: normal;
    color: var(--muted);
}

.topic-item strong {
    font-size: 14px;
    line-height: 1.5;
}

.topic-item p,
.site-info-copy p {
    margin: 0;
    font-size: 13px;
}

.mini-post {
    padding: 12px 0;
    border-radius: 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #edf0f5;
    box-shadow: none;
}

.mini-post:hover {
    transform: none;
    border-color: #dce9ff;
    background: rgba(22, 119, 255, 0.02);
    box-shadow: none;
}

.mini-post strong {
    font-size: 14px;
}

.mini-post p,
.mini-post-meta {
    font-size: 13px;
}

.site-info-copy {
    display: grid;
    gap: 8px;
}

.site-info-copy a {
    color: var(--brand-deep);
}

@media (max-width: 1320px) {
    .homepage-columns {
        grid-template-columns: 200px minmax(0, 1fr) 260px;
    }
}

@media (max-width: 1180px) {
    .homepage-columns {
        grid-template-columns: 196px minmax(0, 1fr);
    }

    .homepage-sidebar-right {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .homepage-columns,
    .homepage-sidebar-right {
        grid-template-columns: 1fr;
    }

    .hero-carousel-track {
        min-height: 280px;
    }
}

@media (max-width: 720px) {
    .homepage-stage {
        padding-bottom: 36px;
    }

    .hero-slide {
        min-height: 240px;
        padding: 20px;
    }

    .home-composer-footer,
    .home-composer-guest {
        flex-direction: column;
        align-items: stretch;
    }

    .home-composer-submit,
    .home-composer-login {
        width: 100%;
    }
}
