/* ==========================================================================
   FORUM PAGE STYLES - Dreamy Coquette Aesthetic
   (Low saturation blue/white/pink, frosted glass, ribbons, lace)
   ========================================================================== */

#forum-app-screen {
    background: linear-gradient(135deg, #fdfbfb 0%, #f0f4f8 50%, #fdf5f7 100%);
    position: relative;
    overflow: hidden;
    font-family: 'Nunito', 'PingFang SC', sans-serif;
    color: #4a5568;
}

/* Background decorative elements (stars, glowing orbs) */
#forum-app-screen::before {
    content: '';
    position: absolute;
    top: -10%; left: -10%; width: 50%; height: 50%;
    background: radial-gradient(circle, rgba(200, 225, 255, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

#forum-app-screen::after {
    content: '';
    position: absolute;
    bottom: -10%; right: -10%; width: 60%; height: 60%;
    background: radial-gradient(circle, rgba(255, 220, 230, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

.forum-page {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* --- Entrance Splash --- */
.forum-splash {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.forum-splash.fade-out {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.forum-splash-inner {
    text-align: center;
    position: relative;
}

.forum-splash-title {
    font-family: 'Dancing Script', cursive;
    font-size: 42px;
    background: linear-gradient(90deg, #93a5cf 0%, #e4efe9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    animation: pulseGlow 2s infinite alternate;
}

.forum-splash-sub {
    font-size: 13px;
    color: #a0aec0;
    letter-spacing: 2px;
}

@keyframes pulseGlow {
    0% { filter: drop-shadow(0 0 5px rgba(147, 165, 207, 0.3)); }
    100% { filter: drop-shadow(0 0 15px rgba(147, 165, 207, 0.7)); }
}

@keyframes forumSpin {
    100% { transform: rotate(360deg); }
}

.forum-icon-btn.spinning {
    animation: forumSpin 1s linear infinite;
    pointer-events: none;
}

/* --- Topbar --- */
.forum-topbar {
    height: 60px;
    padding: calc(env(safe-area-inset-top, 15px) + 10px) 15px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 20px rgba(147, 165, 207, 0.05);
    position: relative;
    z-index: 10;
}

.forum-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    color: #718096;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.forum-icon-btn:active {
    transform: scale(0.92);
    background: #edf2f7;
}

.forum-topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: #4a5568;
    letter-spacing: 1px;
}

/* --- Content Areas --- */
.forum-content-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 15px 15px 90px 15px; /* bottom padding for nav */
    display: none;
    animation: fadeIn 0.3s ease;
}

/* 主页：搜索与刷新固定，仅帖子列表滚动 */
.forum-content-area.forum-tab-home-wrap {
    overflow: hidden;
    display: none;
    flex-direction: column;
}
.forum-content-area.forum-tab-home-wrap.active {
    display: flex;
}
.forum-home-toolbar {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
    background: linear-gradient(180deg, rgba(253, 251, 251, 0.97) 0%, rgba(253, 251, 251, 0.85) 100%);
    padding-bottom: 8px;
    z-index: 2;
}
.forum-home-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.forum-content-area.active:not(.forum-tab-home-wrap) {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Buttons --- */
.forum-btn-primary {
    background: linear-gradient(135deg, rgba(166, 193, 238, 0.8) 0%, rgba(251, 194, 235, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    padding: 10px 20px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(166, 193, 238, 0.3);
    backdrop-filter: blur(5px);
    transition: all 0.2s;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.forum-btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(166, 193, 238, 0.2);
}

.forum-btn-ghost {
    background: rgba(255, 255, 255, 0.6);
    border: 1px dashed rgba(166, 193, 238, 0.5);
    color: #718096;
    padding: 10px 20px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
}

.forum-btn-ghost:active {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(0.96);
}

.forum-btn-soft {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.9);
    color: #93a5cf;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    transition: all 0.2s;
}

/* --- Home Tab --- */
.forum-home-actions {
    display: flex;
    gap: 10px;
}

.forum-empty-hint {
    text-align: center;
    color: #a0aec0;
    font-size: 13px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    border: 1px dashed rgba(200, 210, 230, 0.5);
}

/* --- Bottom Nav --- */
.forum-bottom-nav {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 60px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(147, 165, 207, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 10px;
    z-index: 10;
}

.forum-nav-item {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #a0aec0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 8px 16px;
    border-radius: 20px;
}

.forum-nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(166, 193, 238, 0.9), rgba(251, 194, 235, 0.9));
    box-shadow: 0 4px 12px rgba(166, 193, 238, 0.3);
}

.forum-nav-icon {
    font-size: 18px;
    line-height: 1;
}

.forum-nav-label {
    font-size: 11px;
    font-weight: 600;
}

/* --- Section Headers --- */
.forum-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #4a5568;
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.forum-section-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, #93a5cf, transparent);
    border-radius: 2px;
}

.forum-groups-header, .forum-trending-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* --- Profile Tab --- */
.forum-profile-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    margin-bottom: 15px;
}

.forum-profile-avatar-wrap {
    position: relative;
    width: 70px; height: 70px;
    flex-shrink: 0;
}

.forum-profile-avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(147, 165, 207, 0.2);
}

.forum-avatar-edit-btn {
    position: absolute;
    bottom: -5px; right: -5px;
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 50%;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.forum-profile-info {
    flex: 1;
    min-width: 0;
}

.forum-profile-name {
    font-size: 18px;
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forum-profile-id {
    font-size: 12px;
    color: #93a5cf;
    margin-bottom: 6px;
}

.forum-profile-bio {
    font-size: 12px;
    color: #718096;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.forum-edit-profile-btn {
    padding: 4px 12px;
    font-size: 11px;
}

.forum-profile-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.forum-stat-item {
    text-align: center;
}

.forum-stat-num {
    font-size: 18px;
    font-weight: 800;
    color: #4a5568;
}

.forum-stat-label {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 2px;
}

.forum-profile-actions {
    display: flex;
    gap: 10px;
}

.forum-profile-actions button {
    flex: 1;
}

/* --- Modals --- */
.forum-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(240, 244, 248, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
}

/* 全屏层：用户主页、私信、转发选角色等 */
.forum-modal-overlay.forum-fullscreen-sheet {
    align-items: stretch;
    justify-content: flex-start;
}

.forum-modal-overlay.forum-fullscreen-sheet > .forum-modal {
    max-height: none;
    height: 100%;
    min-height: 0;
    flex: 1;
    border-radius: 0;
    animation: none;
    box-shadow: none;
    border-top: none;
}

.forum-modal {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 20px;
    box-shadow: 0 -10px 40px rgba(147, 165, 207, 0.2);
    border-top: 1px solid rgba(255,255,255,0.8);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.forum-btn-chat-forward {
    border: none;
    background: rgba(147, 165, 207, 0.2);
    color: #5a6a8a;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
}
.forum-btn-chat-forward:active {
    transform: scale(0.96);
    background: rgba(147, 165, 207, 0.35);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.forum-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.forum-modal-body {
    overflow-y: auto;
    flex: 1;
}

.forum-setting-group {
    margin-bottom: 16px;
}

.forum-field-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 6px;
}

.forum-input, .forum-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(200, 210, 230, 0.5);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    color: #2d3748;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.forum-input:focus, .forum-textarea:focus {
    border-color: #93a5cf;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(147, 165, 207, 0.1);
}

.forum-textarea {
    resize: none;
}

.forum-hint {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 4px;
    line-height: 1.4;
}

.forum-wb-select {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 8px;
    border: 1px solid rgba(200, 210, 230, 0.5);
}

.forum-wb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

/* --- DM List & Chat --- */
.forum-dm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    cursor: pointer;
    transition: background 0.2s;
}
.forum-dm-item:hover {
    background: rgba(0,0,0,0.02);
}
.forum-dm-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: bold; font-size: 18px;
    flex-shrink: 0;
}
.forum-dm-info {
    flex: 1; min-width: 0;
}
.forum-dm-name {
    font-size: 15px; font-weight: bold; color: #2d3748;
    margin-bottom: 4px;
}
.forum-dm-preview {
    font-size: 12px; color: #a0aec0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.forum-dm-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.forum-dm-bubble.ai {
    background: #fff;
    color: #4a5568;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.forum-dm-bubble.user {
    background: linear-gradient(135deg, #a6c1ee, #fbc2eb);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    box-shadow: 0 2px 10px rgba(166,193,238,0.3);
}
