/* Community layout v2: a final, scoped responsive pass for the shared hub. */
:root {
    --community-ink: #173b4d;
    --community-copy: #55747d;
    --community-mint: #238f8e;
    --community-surface: #f5fbfb;
    --community-gutter: clamp(16px, 4vw, 56px);
}

/* ===== 站点公告横幅 ===== */
.site-announcement {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: linear-gradient(90deg, #ff6b35, #f7931e);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    position: relative;
    z-index: 10;
}
.site-announcement .announcement-icon {
    font-size: 15px;
    flex-shrink: 0;
}
.site-announcement .announcement-text {
    flex: 1;
    text-align: center;
    letter-spacing: 0.5px;
}
.site-announcement .announcement-close {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.site-announcement .announcement-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

html { scroll-padding-top: 84px; }
body.community-stream,
body.resonance-mobile-page {
    min-width: 0;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.community-stream .home-section {
    min-height: min(100dvh, 940px);
    background:
        linear-gradient(90deg, rgba(246,253,253,.98) 0%, rgba(246,253,253,.92) 34%, rgba(246,253,253,.44) 57%, rgba(246,253,253,.08) 78%),
        url('../assets/community/hero-community-gathering-v1.jpg') 68% center / cover no-repeat !important;
}
body.community-stream .hero-content {
    width: min(1180px, calc(100% - (var(--community-gutter) * 2)));
    margin: 0 auto;
    padding: clamp(8rem, 14vh, 10.5rem) 0 clamp(4rem, 8vh, 6.5rem);
}
body.community-stream .hero-title-wrapper { max-width: 37rem; }
body.community-stream .hero-title {
    max-width: 10ch;
    font-size: clamp(3.2rem, 7vw, 6.4rem);
    line-height: .98;
    letter-spacing: .07em;
}
body.community-stream .hero-subtitle { max-width: 29rem; }
body.community-stream .hero-community-card { max-width: 34rem; }
body.community-stream .hero-routes { max-width: 37rem; }
body.community-stream .section-container { min-width: 0; }

.resonance-mobile-spotlight { display: none; }

/* The dedicated archive page uses the same image language, but keeps touch targets large. */
body.resonance-mobile-page {
    min-height: 100dvh;
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
    background: #edf7f8;
}
.resonance-mobile-page .navbar {
    background: rgba(248,253,253,.9) !important;
    border-bottom: 1px solid rgba(35,143,142,.13);
    box-shadow: 0 8px 24px rgba(36,93,105,.08);
    backdrop-filter: blur(16px);
}
.resonance-mobile-page .navbar-title,
.resonance-mobile-page .navbar-back,
.resonance-mobile-page .navbar-action { color: var(--community-ink) !important; }
.resonance-mobile-page .navbar-back,
.resonance-mobile-page .navbar-action {
    border: 1px solid rgba(35,143,142,.13);
    background: rgba(255,255,255,.72) !important;
}
.resonance-mobile-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    align-content: end;
    min-height: clamp(12rem, 48vw, 20rem);
    margin: 14px auto 0;
    width: min(calc(100% - 32px), 760px);
    overflow: hidden;
    padding: 24px;
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 20px;
    background:
        linear-gradient(90deg, rgba(16,59,77,.72) 0%, rgba(16,59,77,.42) 44%, rgba(16,59,77,.04) 76%),
        url('../assets/community/hero-community-gathering-v1.jpg') 68% center / cover no-repeat;
    box-shadow: 0 18px 32px rgba(36,93,105,.13);
}
.resonance-mobile-hero::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: '';
    background: linear-gradient(180deg, transparent 40%, rgba(11,43,57,.12));
}
.resonance-mobile-hero p {
    max-width: 18rem;
    color: rgba(244,253,253,.86);
    font-size: clamp(.85rem, 2.2vw, 1rem);
    line-height: 1.7;
}
.resonance-mobile-hero strong {
    display: block;
    margin-bottom: 4px;
    color: #fff;
    font-size: clamp(1.35rem, 4vw, 2rem);
    letter-spacing: .06em;
}
.resonance-mobile-page .search-section,
.resonance-mobile-page .filter-section,
.resonance-mobile-page .card-grid,
.resonance-mobile-page .load-more {
    width: min(100%, 760px);
    margin-inline: auto;
}
.resonance-mobile-page .search-section { padding: 16px; background: transparent; }
.resonance-mobile-page .search-box {
    min-height: 48px;
    border: 1px solid rgba(35,143,142,.14);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(36,93,105,.07);
}
.resonance-mobile-page .filter-section {
    padding: 4px 16px 14px;
    background: transparent;
    border: 0;
}
.resonance-mobile-page .filter-row { gap: 8px; }
.resonance-mobile-page .filter-row:last-child { padding-bottom: 6px; }
.resonance-mobile-page .filter-tag {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 11px;
    border-color: rgba(35,143,142,.15);
    background: rgba(255,255,255,.78);
}
.resonance-mobile-page .filter-tag.active {
    background: var(--community-mint);
    border-color: var(--community-mint);
}
.resonance-mobile-page .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 16px 20px;
}
.resonance-mobile-page .card {
    min-width: 0;
    aspect-ratio: 4 / 5;
    border: 1px solid rgba(255,255,255,.92);
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(36,93,105,.10);
}
.resonance-mobile-page .character-image {
    object-position: center top;
}
.resonance-mobile-page .bottom-nav {
    min-height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    background: rgba(250,254,254,.94);
    border-top: 1px solid rgba(35,143,142,.13);
    box-shadow: 0 -8px 24px rgba(36,93,105,.08);
    backdrop-filter: blur(16px);
}

@media (max-width: 900px) {
    body.community-stream .home-section { min-height: 100dvh; }
    body.community-stream .hero-content {
        width: min(100% - 40px, 38rem);
        padding-top: calc(4.5rem + env(safe-area-inset-top));
        padding-bottom: calc(6.8rem + env(safe-area-inset-bottom));
    }
    body.community-stream .mobile-bottom-nav {
        min-height: calc(68px + env(safe-area-inset-bottom));
        padding-inline: 2px;
    }
    body.community-stream .mbn-item { min-width: 0; flex: 1 1 0; padding-inline: 2px; }
    body.community-stream .mbn-icon { font-size: 18px; }
    body.community-stream .mbn-label { font-size: 10px; letter-spacing: 0; }
}

@media (max-width: 768px) {
    html { scroll-padding-top: 0; }
    body.community-stream .home-section {
        min-height: 100dvh;
        align-items: stretch;
        background:
            linear-gradient(180deg, rgba(246,253,253,.06) 0%, rgba(246,253,253,.36) 38%, rgba(246,253,253,.93) 70%, #f4fbfb 100%),
            url('../assets/community/hero-community-gathering-v1.jpg') 63% center / auto 100% no-repeat !important;
    }
    body.community-stream .hero-content {
        justify-content: flex-end;
        display: flex;
        flex-direction: column;
        width: min(100% - 32px, 34rem);
        min-height: 100dvh;
        padding: 4.5rem 0 calc(6.5rem + env(safe-area-inset-bottom));
    }
    body.community-stream .hero-title-wrapper { margin-bottom: 18px; }
    body.community-stream .hero-title { font-size: clamp(2.7rem, 14vw, 4.2rem); }
    body.community-stream .hero-subtitle {
        max-width: 20rem;
        font-size: .95rem;
        line-height: 1.7;
    }
    body.community-stream .hero-community-card {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px 12px;
        width: 100%;
        margin-bottom: 16px;
        padding: 11px;
    }
    body.community-stream .community-cycle { grid-column: 1; }
    body.community-stream .community-link { grid-column: 2; justify-self: end; }
    body.community-stream .hero-routes { width: 100%; margin-bottom: 14px; }
    body.community-stream .world-route small { font-size: 10px; }
    body.community-stream .hero-buttons { width: min(100%, 17rem); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
    body.community-stream .hero-buttons .btn-primary { width: calc(50% - 4px); min-height: 50px; }

    body.community-stream #resonance {
        display: flex !important;
        min-height: auto !important;
        height: auto !important;
        padding: 68px 0 94px !important;
        background: linear-gradient(180deg, #eef9f9, #dff2f0);
    }
    body.community-stream #resonance .section-header.resonance-header {
        position: static !important;
        display: block !important;
        width: min(100% - 32px, 34rem);
        margin: 0 auto 20px !important;
        text-align: left;
    }
    body.community-stream #resonance .resonance-header h2 {
        color: var(--community-ink);
        font-size: clamp(2rem, 9vw, 2.7rem);
        text-shadow: none;
    }
    body.community-stream #resonance .carousel-container,
    body.community-stream #resonance .resonance-view-btn { display: none !important; }
    .resonance-mobile-spotlight {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 7.5rem;
        align-items: stretch;
        gap: 12px;
        width: min(100% - 32px, 34rem);
        margin: 0 auto;
        overflow: hidden;
        padding: 16px;
        border: 1px solid rgba(35,143,142,.14);
        border-radius: 18px;
        background: rgba(255,255,255,.76);
        color: var(--community-ink);
        text-decoration: none;
        box-shadow: 0 14px 28px rgba(36,93,105,.10);
    }
    .resonance-mobile-spotlight strong { display: block; margin-bottom: 7px; font-size: 1.1rem; }
    .resonance-mobile-spotlight span { display: block; color: var(--community-copy); font-size: .83rem; line-height: 1.65; }
    .resonance-mobile-spotlight em { display: inline-block; margin-top: 14px; color: var(--community-mint); font-size: .85rem; font-style: normal; font-weight: 700; }
    .resonance-mobile-spotlight img {
        width: 100%;
        height: 100%;
        min-height: 126px;
        border-radius: 12px;
        object-fit: cover;
        object-position: 55% top;
    }
    body.community-stream .panel-section,
    body.community-stream .panel-section.active { padding: 70px 0 calc(5.8rem + env(safe-area-inset-bottom)); }
    body.community-stream .panel-section .section-container { width: min(100% - 32px, 34rem); }
    body.community-stream .section-header { margin-bottom: 26px; }
    body.community-stream .section-header h2 { font-size: clamp(2rem, 9vw, 2.7rem); line-height: 1.05; }
    body.community-stream .section-header p { max-width: 28rem; line-height: 1.7; }
    body.community-stream .news-list { gap: 12px; }
    body.community-stream .news-item,
    body.community-stream .news-item:first-child { grid-template-columns: 104px minmax(0, 1fr); }
    body.community-stream .news-info { min-width: 0; padding: 15px 13px; }
    body.community-stream .news-title { font-size: .98rem; }
    body.community-stream .news-meta { gap: 6px; font-size: .72rem; }
    body.community-stream .strategy-grid { gap: 12px; }
    body.community-stream .strategy-card:nth-child(n) { min-height: 205px; padding: 22px; }
    body.community-stream .strategy-title { font-size: 1.45rem !important; }
    body.community-stream .strategy-desc { font-size: .85rem; }
    body.community-stream .grid-4 { gap: 12px; }
    body.community-stream .grid-4 .card { min-height: 132px; padding: 18px; }
    body.community-stream .grid-4 .card h3 { font-size: 1rem; }
    body.community-stream .layout-main-side { gap: 18px; }

    .resonance-mobile-hero {
        min-height: 210px;
        padding: 20px;
        background-position: 68% center;
    }
    .resonance-mobile-page .filter-row { overflow-x: auto; overscroll-behavior-inline: contain; }
}

@media (max-width: 380px) {
    body.community-stream .mbn-icon { font-size: 16px; }
    body.community-stream .mbn-label { font-size: 9px; }
    .resonance-mobile-spotlight { grid-template-columns: minmax(0, 1fr) 6.3rem; padding: 13px; }
    .resonance-mobile-page .card-grid { gap: 9px; padding-inline: 12px; }
    .resonance-mobile-page .filter-section,
    .resonance-mobile-page .search-section { padding-inline: 12px; }
}

@media (min-width: 769px) {
    .resonance-mobile-page .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
