/**
 * 白神服Sirokami — 玩家论坛样式
 */
#section-community .back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, var(--red), var(--dark-red));
    color: var(--light-gold);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 999;
}
#section-community .back-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(216,30,68,0.5);
}

.community-wrapper {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 16px;
}
.community-loading {
    text-align: center;
    color: #aaa;
    padding: 60px 20px;
    font-size: 1rem;
}

/* 分区Tab */
.community-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.community-tab {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #aaa;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.2s;
}
.community-tab:hover {
    border-color: rgba(216, 30, 68, 0.4);
    color: #ddd;
}
.community-tab.active {
    background: rgba(216, 30, 68, 0.15);
    border-color: rgba(216, 30, 68, 0.6);
    color: #F0E68C;
    font-weight: 600;
}

/* 工具栏 */
.community-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.community-btn {
    background: rgba(216, 30, 68, 0.8);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}
.community-btn:hover { background: rgba(216, 30, 68, 1); }
.community-sort {
    background: none;
    border: 1px solid #333;
    color: #aaa;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.2s;
}
.community-sort.active {
    border-color: rgba(216, 30, 68, 0.5);
    color: #F0E68C;
}
.community-count {
    color: #888;
    font-size: 0.82rem;
    margin-left: auto;
}
.cm-search-inline {
    width: 130px;
    margin-bottom: 0;
    padding: 5px 8px;
    font-size: 0.75rem;
    margin-left: auto;
}
@media (max-width: 768px) {
    .cm-search-inline {
        width: 110px;
        margin-left: auto;
    }
}

/* 帖子列表 */
.community-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.community-post {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 14px 18px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.community-post:hover {
    border-color: rgba(216, 30, 68, 0.3);
    box-shadow: 0 2px 12px rgba(216, 30, 68, 0.1);
}
.community-post.pinned {
    border-left: 3px solid rgba(216, 30, 68, 0.6);
}
.cp-title {
    color: #F0E68C;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.cp-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    color: #888;
}
.cp-section-tag {
    font-size: 0.7rem;
    background: rgba(216, 30, 68, 0.15);
    color: rgba(216, 30, 68, 0.8);
    padding: 2px 8px;
    border-radius: 3px;
}
.cp-stats {
    display: flex;
    gap: 12px;
}
.cp-empty {
    text-align: center;
    color: #666;
    padding: 60px 20px;
    font-size: 0.9rem;
}

/* 分页 */
.community-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}
.community-page-btn {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #aaa;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
}
.community-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.community-page-info {
    color: #888;
    font-size: 0.82rem;
}
.cp-edit-btn {
    background: none;
    border: 1px solid #444;
    color: #aaa;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: color 0.2s, border-color 0.2s;
}
.cp-edit-btn:hover {
    color: #fff;
    border-color: #888;
}

/* 弹窗 */
.community-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50000;
    background: rgba(0, 0, 0, 0.82);
    display: none;
    align-items: center;
    justify-content: center;
}
.community-modal-overlay.active {
    display: flex;
}
.community-modal {
    background: #12121c;
    border: 1px solid rgba(216, 30, 68, 0.5);
    border-radius: 14px;
    width: min(700px, 95vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.community-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.community-modal-title {
    color: #F0E68C;
    font-weight: 700;
    font-size: 1.05rem;
}
.community-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.community-modal-close:hover { color: #fff; }
.community-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    scrollbar-width: thin;
    scrollbar-color: var(--red, #D81E44) transparent;
}
.community-modal-body::-webkit-scrollbar {
    width: 6px;
}
.community-modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.community-modal-body::-webkit-scrollbar-thumb {
    background: var(--red, #D81E44);
    border-radius: 3px;
}

/* 表单 */
.community-input {
    width: 100%;
    box-sizing: border-box;
    background: #0d0d0d;
    border: 1px solid #333;
    color: #ddd;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.88rem;
    margin-bottom: 10px;
    outline: none;
}
.community-input:focus { border-color: rgba(216, 30, 68, 0.5); }
.community-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}
.community-form-label {
    color: #aaa;
    font-size: 0.78rem;
    margin-bottom: 4px;
}

/* 评论区 */
.community-reply {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding: 10px 0;
}
.community-reply:last-child { border-bottom: none; }
.cr-author {
    color: #F0E68C;
    font-size: 0.82rem;
    font-weight: 600;
}
.cr-time {
    color: #666;
    font-size: 0.7rem;
    margin-left: 8px;
}
.cr-content {
    color: #ccc;
    font-size: 0.85rem;
    margin-top: 4px;
    line-height: 1.5;
}

/* 个人中心 */
#cmProfileBody {
    padding: 14px;
}
.community-modal.profile-modal {
    border: 2px solid var(--red, #D81E44) !important;
    box-shadow: 0 0 20px rgba(216, 30, 68, 0.3);
}
.profile-panel .community-tab {
    font-size: 0.8rem;
    padding: 6px 14px;
}

/* 卡片搜索浮层 */
.card-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 60000;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
}
.card-search-overlay.active { display: flex; }
.card-search-box {
    background: #1a1a2e;
    border: 1px solid rgba(216,30,68,0.3);
    border-radius: 12px;
    width: min(500px, 92vw);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.card-search-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.card-search-input {
    width: 100%;
    box-sizing: border-box;
    background: #0d0d0d;
    border: 1px solid #333;
    color: #ddd;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}
.card-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
}
.card-search-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.card-search-item:hover { border-color: rgba(216,30,68,0.4); }
.card-search-item img {
    width: 40px;
    height: 58px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}
.card-search-item-name {
    color: #ddd;
    font-size: 0.75rem;
    line-height: 1.3;
}

@media (max-width: 768px) {
    #section-community .back-btn { top: 60px; }
    .cm-mobile-avatar {
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 998;
    }
    .cm-mobile-avatar img {
        width: 36px !important;
        height: 36px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.5);
        border: 2px solid var(--red, #D81E44) !important;
    }
    .community-tabs { gap: 4px; }
    .community-tab { padding: 6px 12px; font-size: 0.78rem; }
    .community-post { padding: 10px 12px; }
    .cp-title { font-size: 0.9rem; }
    .community-modal {
        width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
}
