:root{
    --primary:#4a6cf7;
    --primary-dark:#3a56d4;
    --secondary:#6c757d;
    --light:#f8f9fa;
    --dark:#1e2a4a;
    --success:#00d97e;
    --danger:#e63757;
    --warning:#f6c343;
}
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;
}
body{
    background-color:#f5f7fa;
    color:#333;
    line-height:1.6;
}
.container{
    max-width:1200px;
    margin:0 auto;
    padding:0 20px;
}
.section{
    padding:40px 0;
}
header{
    background-color:white;
    box-shadow:0 2px 10px rgba(0,0,0,.05);
    position:sticky;
    top:0;
    z-index:100;
}
.navbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:15px 0;
}
.logo{
    display:flex;
    align-items:center;
    font-size:24px;
    font-weight:700;
    color:var(--primary);
}
.nav-links{
    display:flex;
    list-style:none;
}
.nav-links li{
    margin-left:25px;
}
.nav-links a{
    color:var(--dark);
    font-weight:500;
    transition:color .3s;
    padding:5px 0;
    position:relative;
}
.nav-links a:hover{
    color:var(--primary);
}
.nav-links a.active{
    color:var(--primary);
    font-weight:600;
}
.nav-links a.active::after{
    content:'';
    position:absolute;
    bottom:0;
    left:0;
    width:100%;
    height:2px;
    background-color:var(--primary);
}
.user-menu{
    display:flex;
    align-items:center;
    cursor:pointer;
}
.user-avatar{
    width:36px;
    height:36px;
    border-radius:50%;
    background-color:var(--primary);
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
    margin-right:10px;
}
.login-actions{
    display:flex;
    gap:10px;
}
.user-info-display{
    display:flex;
    align-items:center;
    gap:12px;
}
#navUsername{
    font-weight:500;
    color:var(--dark);
}
.logout-btn{
    display:flex;
    align-items:center;
    gap:5px;
    padding:6px 12px;
    background:transparent;
    color:var(--secondary);
    border:1px solid #ddd;
    border-radius:4px;
    text-decoration:none;
    font-size:.85rem;
    transition:all .3s;
}
.logout-btn:hover{
    background-color:#f8f9fa;
    border-color:var(--secondary);
    color:var(--dark);
}
.page-header{
    background:linear-gradient(135deg,#4a6cf7,#6a8eff);
    color:white;
    padding:60px 0;
    text-align:center;
}
.page-header h1{
    font-size:36px;
    margin-bottom:15px;
}
.page-header p{
    font-size:18px;
    opacity:.9;
    max-width:600px;
    margin:0 auto;
}
.community-card{
    background:white;
    border-radius:12px;
    padding:30px;
    box-shadow:0 4px 12px rgba(0,0,0,.05);
    margin-bottom:30px;
}
.card-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
    padding-bottom:15px;
    border-bottom:1px solid #e2e8f0;
}
.card-header h2{
    font-size:24px;
    font-weight:600;
    color:#1e2a4a;
}
.card-actions{
    display:flex;
    gap:15px;
    align-items:center;
}
.btn{
    padding:10px 20px;
    border-radius:6px;
    font-size:14px;
    font-weight:500;
    cursor:pointer;
    transition:all .2s;
    text-decoration:none;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
}
.btn-outline{
    background:transparent;
    border:1px solid #d1d5db;
    color:#374151;
}
.btn-outline:hover{
    background:#f9fafb;
    border-color:#9ca3af;
}
.btn-primary{
    background:linear-gradient(135deg,#4a6cf7,#6a8eff);
    color:white;
    border:none;
}
.btn-primary:hover{
    box-shadow:0 4px 12px rgba(74,108,247,.25);
}
.create-post-btn{
    background:linear-gradient(135deg,#4a6cf7,#6a8eff);
    color:white;
    border:none;
    padding:10px 20px;
    border-radius:6px;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    transition:all .3s ease;
    box-shadow:0 2px 8px rgba(74,108,247,.15);
    display:inline-flex;
    align-items:center;
    gap:8px;
}
.create-post-btn:hover{
    transform:translateY(-2px);
    box-shadow:0 4px 12px rgba(74,108,247,.25);
}
.categories-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
    gap:20px;
    margin-top:20px;
}
.category-card{
    background:white;
    border-radius:12px;
    padding:24px;
    box-shadow:0 4px 12px rgba(0,0,0,.05);
    transition:all .3s ease;
    cursor:pointer;
    position:relative;
    overflow:hidden;
    border:2px solid transparent;
}
.category-card:hover{
    transform:translateY(-5px);
    box-shadow:0 8px 20px rgba(0,0,0,.1);
    border-color:#4a6cf7;
}
.category-card.active{
    border-color:#4a6cf7;
    background:linear-gradient(135deg,#f8faff 0%,#f0f4ff 100%);
}
.category-card::before{
    content:'';
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:4px;
    background:linear-gradient(90deg,#4a6cf7,#6a8eff);
    transform:scaleX(0);
    transition:transform .3s ease;
}
.category-card.active::before,.category-card:hover::before{
    transform:scaleX(1);
}
.category-icon{
    width:60px;
    height:60px;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin-bottom:16px;
    background:linear-gradient(135deg,#4a6cf7,#6a8eff);
    color:white;
    font-size:24px;
}
.category-card h3{
    font-size:18px;
    font-weight:600;
    margin-bottom:8px;
    color:#1e2a4a;
}
.category-card p{
    color:#64748b;
    font-size:14px;
    margin-bottom:16px;
    line-height:1.5;
}
.category-stats{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:16px;
}
.topic-label{
    background:#f1f5f9;
    color:#475569;
    padding:4px 12px;
    border-radius:20px;
    font-size:12px;
    font-weight:500;
}
.category-card.active .topic-label{
    background:#4a6cf7;
    color:white;
}
.category-posts-count{
    font-size:12px;
    color:#94a3b8;
    display:flex;
    align-items:center;
}
.category-posts-count i{
    margin-right:4px;
}
.posts-list{
    list-style:none;
}
.post-item{
    background:white;
    border-radius:8px;
    padding:20px;
    margin-bottom:15px;
    box-shadow:0 2px 6px rgba(0,0,0,.03);
    transition:all .2s;
    border:1px solid #f1f5f9;
}
.post-item:hover{
    box-shadow:0 4px 12px rgba(0,0,0,.08);
    transform:translateY(-2px);
}
.post-header{
    display:flex;
    align-items:center;
    margin-bottom:12px;
}
.post-avatar{
    width:32px;
    height:32px;
    border-radius:50%;
    background:linear-gradient(135deg,#4a6cf7,#6a8eff);
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:600;
    margin-right:10px;
}
.post-author{
    font-weight:600;
    color:#1e2a4a;
    margin-right:10px;
}
.post-time{
    color:#94a3b8;
    font-size:12px;
}
.post-title{
    font-size:18px;
    font-weight:600;
    color:#1e2a4a;
    text-decoration:none;
    display:block;
    margin-bottom:8px;
    transition:color .2s;
}
.post-title:hover{
    color:#4a6cf7;
}
.post-excerpt{
    color:#64748b;
    font-size:14px;
    margin-bottom:12px;
    line-height:1.5;
}
.post-stats{
    display:flex;
    justify-content:space-between;
    align-items:center;
}
.post-actions{
    display:flex;
    gap:15px;
}
.post-action{
    display:flex;
    align-items:center;
    gap:5px;
    color:#64748b;
    font-size:13px;
}
.post-action i{
    font-size:14px;
}
.like-action.liked i{
    color:#ef4444;
}
.post-category{
    background:#f1f5f9;
    color:#475569;
    padding:4px 10px;
    border-radius:20px;
    font-size:12px;
    font-weight:500;
}
.filtered-posts{
    margin-top:30px;
    display:none;
}
.filtered-posts.active{
    display:block;
}
.filter-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
    padding-bottom:15px;
    border-bottom:1px solid #e2e8f0;
}
.filter-title{
    font-size:20px;
    font-weight:600;
    color:#1e2a4a;
}
.filter-title span{
    color:#4a6cf7;
}
.clear-filter{
    background:none;
    border:none;
    color:#64748b;
    cursor:pointer;
    display:flex;
    align-items:center;
    font-size:14px;
    transition:color .2s;
}
.clear-filter:hover{
    color:#4a6cf7;
}
.clear-filter i{
    margin-right:6px;
}
.simple-posts-list{
    list-style:none;
}
.simple-post-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:15px 0;
    border-bottom:1px solid #f1f5f9;
}
.simple-post-item:last-child{
    border-bottom:none;
}
.simple-post-info{
    display:flex;
    align-items:center;
    flex:1;
}
.simple-post-avatar{
    width:36px;
    height:36px;
    border-radius:50%;
    background:linear-gradient(135deg,#4a6cf7,#6a8eff);
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:600;
    margin-right:12px;
}
.simple-post-details{
    flex:1;
}
.simple-post-title{
    font-size:16px;
    font-weight:600;
    color:#1e2a4a;
    text-decoration:none;
    transition:color .2s;
}
.simple-post-title:hover{
    color:#4a6cf7;
}
.simple-post-meta{
    display:flex;
    align-items:center;
    margin-top:4px;
    font-size:13px;
    color:#64748b;
}
.simple-post-author{
    font-weight:500;
    margin-right:10px;
}
.simple-post-date{
    color:#94a3b8;
}
.simple-post-actions{
    display:flex;
    gap:10px;
}
.btn-sm{
    padding:6px 12px;
    font-size:12px;
}
.pagination{
    display:flex;
    justify-content:center;
    align-items:center;
    margin-top:30px;
    gap:10px;
}
.pagination-btn{
    padding:8px 12px;
    background:white;
    border:1px solid #d1d5db;
    border-radius:6px;
    color:#374151;
    cursor:pointer;
    transition:all .2s;
    text-decoration:none;
}
.pagination-btn:hover{
    background:#f9fafb;
    border-color:#9ca3af;
}
.pagination-btn.active{
    background:#4a6cf7;
    color:white;
    border-color:#4a6cf7;
}
.pagination-btn.disabled{
    opacity:.5;
    cursor:not-allowed;
}
.pagination-btn.disabled:hover{
    background:white;
    border-color:#d1d5db;
}
.pagination-info{
    font-size:14px;
    color:#64748b;
    margin:0 15px;
}
.community-content{
    display:grid;
    grid-template-columns:1fr 350px;
    gap:30px;
}
.community-sidebar{
    display:flex;
    flex-direction:column;
    gap:30px;
}
.stats-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:15px;
}
.stat-item{
    background:#f8fafc;
    border-radius:8px;
    padding:20px;
    text-align:center;
}
.stat-value{
    font-size:24px;
    font-weight:700;
    color:#1e2a4a;
    margin-bottom:5px;
}
.stat-label{
    font-size:14px;
    color:#64748b;
}
.topics-list{
    list-style:none;
}
.topic-item{
    display:flex;
    align-items:center;
    padding:15px 0;
    border-bottom:1px solid #f1f5f9;
}
.topic-item:last-child{
    border-bottom:none;
}
.topic-icon{
    width:40px;
    height:40px;
    border-radius:8px;
    background:#f1f5f9;
    display:flex;
    align-items:center;
    justify-content:center;
    margin-right:15px;
    color:#64748b;
}
.topic-content{
    flex:1;
}
.topic-title{
    font-weight:600;
    color:#1e2a4a;
    text-decoration:none;
    display:block;
    margin-bottom:5px;
    font-size:14px;
}
.topic-title:hover{
    color:#4a6cf7;
}
.topic-meta{
    display:flex;
    gap:10px;
    font-size:12px;
    color:#94a3b8;
}
.topic-stats{
    text-align:right;
}
.topic-count{
    font-weight:700;
    color:#1e2a4a;
    font-size:16px;
}
.topic-label{
    font-size:12px;
    color:#94a3b8;
}
.users-list{
    display:flex;
    flex-direction:column;
    gap:15px;
}
.user-item{
    display:flex;
    align-items:center;
    padding:10px 0;
}
.user-avatar-small{
    width:36px;
    height:36px;
    border-radius:50%;
    background:linear-gradient(135deg,#4a6cf7,#6a8eff);
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:600;
    margin-right:12px;
}
.user-name{
    font-weight:500;
    color:#1e2a4a;
}
.user-activity-badge{
    display:inline-block;
    background:#10b981;
    color:white;
    border-radius:10px;
    padding:1px 6px;
    font-size:10px;
    margin-left:5px;
}
footer{
    background:#1e2a4a;
    color:white;
    padding:50px 0 20px;
}
.footer-content{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:30px;
    margin-bottom:30px;
}
.footer-column h3{
    font-size:18px;
    margin-bottom:20px;
    color:white;
}
.footer-links{
    list-style:none;
}
.footer-links li{
    margin-bottom:10px;
}
.footer-links a{
    color:#cbd5e1;
    text-decoration:none;
    transition:color .2s;
}
.footer-links a:hover{
    color:white;
}
.copyright{
    text-align:center;
    padding-top:20px;
    border-top:1px solid #334155;
    color:#94a3b8;
    font-size:14px;
}
@media (max-width:1024px){
    .community-content{
        grid-template-columns:1fr;
    }
    .footer-content{
        grid-template-columns:repeat(2,1fr);
    }
}
@media (max-width:768px){
    .categories-grid{
        grid-template-columns:1fr;
    }
    .category-card{
        padding:20px;
    }
    .card-header{
        flex-direction:column;
        align-items:flex-start;
        gap:15px;
    }
    .card-actions{
        width:100%;
        justify-content:space-between;
    }
    .navbar{
        flex-direction:column;
        gap:15px;
    }
    .nav-links{
        flex-wrap:wrap;
        justify-content:center;
    }
    .footer-content{
        grid-template-columns:1fr;
    }
    .simple-post-item{
        flex-direction:column;
        align-items:flex-start;
        gap:10px;
    }
    .simple-post-actions{
        width:100%;
        justify-content:flex-end;
    }
}
.empty-state{
    text-align:center;
    padding:40px 20px;
    color:#64748b;
}
.empty-state i{
    font-size:48px;
    margin-bottom:16px;
    color:#cbd5e1;
}
.empty-state h3{
    font-size:18px;
    margin-bottom:8px;
    color:#475569;
}
.empty-state p{
    font-size:14px;
}
.modal{
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background-color:rgba(0,0,0,.5);
    z-index:1000;
    align-items:center;
    justify-content:center;
    backdrop-filter:blur(2px);
}
.modal-content{
    background-color:white;
    border-radius:8px;
    width:90%;
    max-width:500px;
    padding:30px;
    box-shadow:0 5px 25px rgba(0,0,0,.2);
    position:relative;
}
.modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}
.modal-title{
    font-size:1.5rem;
    font-weight:600;
}
.close-modal{
    background:none;
    border:none;
    font-size:1.5rem;
    cursor:pointer;
    color:var(--secondary);
}
.form-group{
    margin-bottom:20px;
}
.form-group label{
    display:block;
    margin-bottom:8px;
    font-weight:500;
}
.form-control{
    width:100%;
    padding:10px 15px;
    border:1px solid #ddd;
    border-radius:4px;
    font-size:1rem;
}
.form-control:focus{
    outline:none;
    border-color:var(--primary);
}
.form-but{
    text-align:center;
}
.form-but .btn{
    margin:0 10px;
}
.form-switch{
    text-align:center;
    margin-top:15px;
}
.form-switch a{
    color:var(--primary);
    cursor:pointer;
}
.form-switch a:hover{
    text-decoration:underline;
}
.user-roles{
    display:flex;
    flex-direction:column;
    gap:2px;
    margin-left:8px;
}
.role-tag{
    padding:2px 8px;
    border-radius:3px;
    font-size:.7rem;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:.5px;
    white-space:nowrap;
}
.role-user{
    background-color:#6c757d;
    color:white;
}
.role-contributor{
    background-color:#17a2b8;
    color:white;
}
.role-admin{
    background-color:#dc3545;
    color:white;
}
.role-vip{
    background-color:#ffc107;
    color:#212529;
}
.user-name-roles-container{
    display:flex;
    align-items:center;
}
.panel-roles{
    display:flex;
    flex-direction:row;
    gap:5px;
    margin-top:5px;
    flex-wrap:wrap;
}
.loading{
    display:inline-block;
    width:20px;
    height:20px;
    border:3px solid #f3f3f3;
    border-top:3px solid #3498db;
    border-radius:50%;
    animation:spin 1s linear infinite;
}
@keyframes spin{
    0%{transform:rotate(0deg);}
    100%{transform:rotate(360deg);}
}
.alert{
    position:fixed;
    top:20px;
    right:20px;
    padding:15px 20px;
    border-radius:5px;
    color:white;
    z-index:10000;
    max-width:300px;
    box-shadow:0 4px 12px rgba(0,0,0,.15);
    animation:slideIn .3s ease;
}
.alert-success{
    background-color:#28a745;
}
.alert-error{
    background-color:#dc3545;
}
.alert-warning{
    background-color:#ffc107;
    color:#212529;
}
.alert-info{
    background-color:#17a2b8;
}
@keyframes slideIn{
    from{
        transform:translateX(100%);
        opacity:0;
    }
    to{
        transform:translateX(0);
        opacity:1;
    }
}
.editor-toolbar{
    display:flex;
    flex-wrap:wrap;
    gap:5px;
    padding:10px;
    background:#f8f9fa;
    border-bottom:1px solid #e2e8f0;
    position:relative;
}
.toolbar-group{
    display:flex;
    gap:2px;
    margin-right:10px;
    position:relative;
}
.editor-btn{
    background:none;
    border:none;
    padding:6px 8px;
    border-radius:4px;
    cursor:pointer;
    font-size:14px;
    color:#64748b;
    transition:all .2s;
    position:relative;
}
.editor-btn:hover{
    background:#e2e8f0;
    color:#374151;
}
.editor-btn.active{
    background:#4a6cf7;
    color:white;
}
.editor-content{
    min-height:300px;
    padding:15px;
    border:1px solid #d1d5db;
    border-radius:6px;
    font-size:14px;
    line-height:1.5;
    resize:vertical;
    outline:none;
}
.editor-content:focus{
    border-color:#4a6cf7;
}
.editor-content img{
    max-width:100%;
    height:auto;
}
.editor-content code{
    background:#f1f5f9;
    padding:2px 4px;
    border-radius:3px;
    font-family:'Courier New',monospace;
}
.editor-content pre{
    background:#f8f9fa;
    padding:12px;
    border-radius:6px;
    overflow-x:auto;
    font-family:'Courier New',monospace;
    font-size:13px;
}
.editor-content blockquote{
    border-left:4px solid #4a6cf7;
    padding-left:12px;
    margin-left:0;
    color:#64748b;
    font-style:italic;
}
.emoji-picker{
    display:none;
    position:absolute;
    background:white;
    border:1px solid #d1d5db;
    border-radius:8px;
    box-shadow:0 10px 25px rgba(0,0,0,.2);
    padding:10px;
    z-index:10000;
    width:500px;
    height:220px;
    overflow-y:auto;
    overflow-x:hidden;
    grid-template-columns:repeat(12,1fr);
    gap:5px;
    box-sizing:border-box;
    top:100%;
    left:0;
    margin-top:5px;
}
.emoji-picker.active{
    display:grid;
}
.emoji-item{
    font-size:18px;
    cursor:pointer;
    padding:5px;
    text-align:center;
    border-radius:4px;
    transition:background .2s;
    white-space:nowrap;
    min-width:30px;
    height:30px;
    display:flex;
    align-items:center;
    justify-content:center;
}
.emoji-item:hover{
    background:#f1f5f9;
}
.link-modal,.image-modal,.code-modal{
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,.5);
    z-index:1500;
    align-items:center;
    justify-content:center;
}
.link-modal-content,.image-modal-content,.code-modal-content{
    background:white;
    border-radius:8px;
    width:90%;
    max-width:400px;
    padding:20px;
    box-shadow:0 4px 12px rgba(0,0,0,.15);
    z-index:1501;
}
.link-modal-header,.image-modal-header,.code-modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:15px;
    padding-bottom:10px;
    border-bottom:1px solid #e2e8f0;
}
.link-modal-title,.image-modal-title,.code-modal-title{
    font-size:18px;
    font-weight:600;
    color:#1e2a4a;
}
.link-modal-close,.image-modal-close,.code-modal-close{
    background:none;
    border:none;
    font-size:20px;
    cursor:pointer;
    color:#64748b;
}
.link-modal-footer,.image-modal-footer,.code-modal-footer{
    display:flex;
    justify-content:flex-end;
    gap:10px;
}
.color-picker{
    display:none;
    position:absolute;
    background:white;
    border:1px solid #d1d5db;
    border-radius:8px;
    box-shadow:0 10px 25px rgba(0,0,0,.2);
    padding:10px;
    z-index:2000;
    width:200px;
    top:100%;
    left:0;
    margin-top:5px;
}
.color-picker.active{
    display:block;
}
.color-grid{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:5px;
    margin-bottom:10px;
}
.color-item{
    width:30px;
    height:30px;
    border-radius:4px;
    cursor:pointer;
    border:1px solid #e2e8f0;
}
.color-item:hover{
    transform:scale(1.1);
}
.custom-color-input{
    display:flex;
    align-items:center;
    gap:10px;
}
.custom-color-input input{
    flex:1;
    padding:6px;
    border:1px solid #d1d5db;
    border-radius:4px;
}
#postModal .modal-content{
    max-width:800px;
    width:95%;
    z-index:1200;
    position:relative;
}
#postModal .editor-toolbar{
    flex-wrap:nowrap;
    overflow-x:auto;
    white-space:nowrap;
    padding:12px 15px;
    position:relative;
    z-index:1;
}
#postModal .toolbar-group{
    margin-right:15px;
    flex-shrink:0;
    position:relative;
}
#postModal .editor-btn{
    flex-shrink:0;
    padding:8px 10px;
    min-width:36px;
}
#postModal .editor-content{
    min-height:350px;
    max-height:500px;
    overflow-y:auto;
    font-size:16px;
    line-height:1.6;
    scrollbar-width:thin;
    scrollbar-color:#cbd5e1 #f1f5f9;
    position:relative;
    z-index:1;
}
#postModal .editor-content::-webkit-scrollbar{
    width:8px;
}
#postModal .editor-content::-webkit-scrollbar-track{
    background:#f1f5f9;
    border-radius:4px;
}
#postModal .editor-content::-webkit-scrollbar-thumb{
    background:#cbd5e1;
    border-radius:4px;
}
#postModal .editor-content::-webkit-scrollbar-thumb:hover{
    background:#94a3b8;
}
#postModal .modal-title{
    font-size:1.8rem;
    margin-bottom:10px;
}
#postModal .form-group{
    margin-bottom:25px;
    position:relative;
    z-index:1;
}
#postModal .form-control{
    padding:12px 15px;
    font-size:16px;
}
#postModal .form-but{
    margin-top:20px;
    text-align:center;
}
#postModal .form-but .btn{
    padding:12px 30px;
    font-size:16px;
    min-width:120px;
}
@media (max-width:850px){
    #postModal .modal-content{
        max-width:95%;
        margin:20px;
    }
    #postModal .editor-toolbar{
        padding:10px 12px;
    }
    #postModal .editor-btn{
        padding:6px 8px;
        font-size:13px;
        min-width:32px;
    }
    #postModal .editor-content{
        min-height:300px;
        max-height:400px;
    }
}
@media (max-width:600px){
    #postModal .modal-content{
        padding:20px;
    }
    #postModal .editor-toolbar{
        padding:8px 10px;
    }
    #postModal .toolbar-group{
        margin-right:10px;
    }
    #postModal .editor-content{
        min-height:250px;
        max-height:350px;
    }
}
#postModal .editor-toolbar.compact{
    gap:1px;
    padding:10px 12px;
}
#postModal .editor-toolbar.compact .toolbar-group{
    margin-right:8px;
    gap:1px;
}
#postModal .editor-toolbar.compact .editor-btn{
    padding:6px 8px;
    min-width:32px;
    font-size:13px;
}

html,body{
    height:100%;
    overflow-x:hidden;
    scroll-behavior:smooth;
}
a{
    text-decoration:none;
    color:var(--primary);
}
.community-main{
    display:flex;
    flex-direction:column;
    gap:30px;
}
.post-tags{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-bottom:10px;
}
.post-tag{
    background-color:#f0f4f8;
    color:var(--primary);
    padding:3px 8px;
    border-radius:4px;
    font-size:.8rem;
}
.redirect-notice{
    background-color:#e8f4fd;
    border:1px solid #b6d7f2;
    border-radius:4px;
    padding:12px 16px;
    margin-bottom:15px;
    font-size:.9rem;
    color:#1a5a96;
    display:flex;
    align-items:center;
    gap:10px;
}
.redirect-notice i{
    color:var(--primary);
}
.panel-role-tag{
    display:inline-block;
    padding:4px 8px;
    border-radius:4px;
    font-size:.75rem;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:.5px;
    white-space:nowrap;
}
.quick-post{
    background-color:white;
    border-radius:8px;
    padding:20px;
    box-shadow:0 5px 15px rgba(0,0,0,.05);
}
.quick-post textarea{
    width:100%;
    padding:15px;
    border:1px solid #ddd;
    border-radius:4px;
    resize:vertical;
    min-height:100px;
    margin-bottom:15px;
    font-family:inherit;
    transition:border-color .2s;
}
.quick-post textarea:focus{
    outline:none;
    border-color:var(--primary);
}
.quick-post-actions{
    display:flex;
    justify-content:space-between;
    align-items:center;
}
.post-options{
    display:flex;
    gap:10px;
}
.post-option{
    display:flex;
    align-items:center;
    color:var(--secondary);
    cursor:pointer;
    transition:color .2s;
}
.post-option:hover{
    color:var(--primary);
}
.post-option i{
    margin-right:5px;
}

@media (max-width:992px){
    .community-sidebar{
        order:-1;
    }
}
@media (max-width:768px){
    .user-info-display{
        flex-direction:column;
        align-items:center;
        gap:8px;
    }
    .logout-btn{
        margin-top:5px;
    }
    .quick-post-actions{
        flex-direction:column;
        gap:15px;
    }
    .post-options{
        width:100%;
        justify-content:space-between;
    }
}
#postModal .editor-content {
    height: 320px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    outline: none;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

#postModal .editor-content::-webkit-scrollbar {
    width: 8px;
}
#postModal .editor-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

@media (max-width: 600px) {
    #postModal .emoji-picker {
        width: 350px;
        height: 180px;
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 400px) {
    #postModal .emoji-picker {
        width: 300px;
        height: 160px;
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 修复选择器定位问题 */
#postModal {
    z-index: 1200;
}

#postModal .modal-content {
    position: relative;
}

/* 确保选择器在模态框之上 */
.color-picker,
.emoji-picker {
    z-index: 2001 !important;
}

/* 修复工具栏组的相对定位 */
.toolbar-group {
    position: relative !important;
}

/* 确保选择器显示在正确位置 */
.editor-btn[data-command="insertColor"],
.editor-btn[data-command="insertEmoji"] {
    position: relative;
}

/* 修复选择器溢出问题 */
#postModal .editor-toolbar {
    overflow: visible !important;
    position: relative;   /* 让 z-index 生效 */
    z-index: 1;         /* 需要比遮挡它的元素高即可 */
}

.toolbar-group {
    overflow: visible !important;
}
/* 让模态框内容成为定位祖先 */
#postModal .modal-content { position: relative; }

/* 保证层级最高 */
.emoji-picker { z-index: 2001 !important; }

/* 允许工具栏溢出，防止被裁剪 */
#postModal .editor-toolbar { overflow: visible !important; }