:root {
    --bg: #070a0f;
    --bg2: #0d1219;
    --surface: #131b27;
    --surface2: #1a2536;
    --border: rgba(255,255,255,0.07);
    --border2: rgba(255,255,255,0.12);
    --text: #e8ecf1;
    --text2: #8b97a8;
    --text3: #5a6578;
    --accent: #ff4d4f;
    --accent2: #ff6b6d;
    --accentSoft: rgba(255,77,79,0.12);
    --accentSoft2: rgba(255,77,79,0.20);
    --success: #34d399;
    --radius: 14px;
    --radius2: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans SC', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* HEADER */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(7,10,15,0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    height: 58px;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
}

.logo img { width: 30px; height: 30px; border-radius: 8px; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-btn {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    color: var(--text2);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.nav-btn:hover { background: var(--surface); color: var(--text); }
.nav-btn.active { color: var(--accent); background: var(--accentSoft); }
.nav-btn.primary { background: var(--accent); color: #fff; font-weight: 600; }
.nav-btn.primary:hover { background: var(--accent2); }

/* USER MENU */
.user-menu { position: relative; }
.user-menu-trigger { cursor: pointer; }
.user-avatar-sm {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700; color: #fff;
    font-size: 0.9rem;
}
.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    min-width: 160px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.dropdown-item {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--text2);
    cursor: pointer;
    transition: background 0.15s;
}
.dropdown-item:hover { background: var(--surface2); color: var(--text); }
.dropdown-item.danger { color: var(--accent); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* MAIN */
.main-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 74px 20px 50px;
    display: grid;
    grid-template-columns: 260px 1fr 270px;
    gap: 20px;
    align-items: start;
}

/* LEFT SIDEBAR */
.sidebar-left { position: sticky; top: 74px; }

.user-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    padding: 24px 20px;
    text-align: center;
}

.user-avatar-lg {
    width: 72px; height: 72px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: grid; place-items: center;
    font-size: 1.8rem; font-weight: 700; color: #fff;
}

.user-name-lg { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }
.user-bio-sm { color: var(--text2); font-size: 0.85rem; margin-bottom: 16px; }

.user-stats-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.stat-sm { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.stat-sm span:first-child { font-weight: 700; font-size: 1rem; }
.stat-label-sm { font-size: 0.75rem; color: var(--text3); }

.sidebar-nav {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    margin-top: 14px;
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    color: var(--text2);
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.menu-item:hover { background: var(--surface2); color: var(--text); }
.menu-item.active { background: var(--accentSoft); color: var(--accent); border-left-color: var(--accent); }
.menu-item .icon { font-size: 1.2rem; }

/* FEED */
.feed-col { min-width: 0; }

.compose-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    padding: 18px;
    margin-bottom: 14px;
}

.compose-top { display: flex; gap: 12px; align-items: flex-start; }

.avatar-circle {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700; color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.compose-input {
    flex: 1;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 11px 16px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    transition: border-color 0.2s;
}
.compose-input:focus { outline: none; border-color: var(--accent); }
.compose-input::placeholder { color: var(--text3); }

.compose-images-preview {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.compose-images-preview img {
    width: 90px; height: 90px;
    object-fit: cover;
    border-radius: 10px;
}

.compose-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.compose-tools-left { display: flex; gap: 4px; }

.compose-tool-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg2);
    border: none;
    font-family: inherit;
}
.compose-tool-btn:hover { background: var(--surface2); color: var(--text); }

.compose-submit-btn {
    padding: 9px 22px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.compose-submit-btn:hover { background: var(--accent2); box-shadow: 0 4px 16px rgba(255,77,79,0.3); }

/* POST CARD */
.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    margin-bottom: 14px;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

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

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px 12px;
}

.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.post-avatar { font-size: 1rem; }

.post-meta { flex: 1; min-width: 0; }
.post-author { font-weight: 600; font-size: 0.93rem; display: flex; align-items: center; gap: 5px; }
.post-time { font-size: 0.78rem; color: var(--text3); }
.verified { color: #4facfe; font-size: 0.8rem; }

.post-more {
    color: var(--text3); font-size: 1.3rem;
    cursor: pointer; padding: 4px 8px;
    border-radius: 8px; transition: background 0.15s;
}
.post-more:hover { background: var(--surface2); }

.post-content { padding: 0 18px 12px; font-size: 0.95rem; line-height: 1.7; color: var(--text); }

.post-images { padding: 0 0 12px; }
.post-images.grid-1 img { width: 100%; max-height: 420px; object-fit: cover; }
.post-images.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 0 0 12px; }
.post-images.grid-2 img { width: 100%; height: 220px; object-fit: cover; }
.post-images.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 4px; padding: 0 0 12px; }
.post-images.grid-3 img:first-child { height: 444px; object-fit: cover; }
.post-images.grid-3 img:not(:first-child) { height: 220px; object-fit: cover; }

.post-actions {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    gap: 2px;
}

.action-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 7px 12px;
    border-radius: 999px;
    border: none; background: none;
    color: var(--text2);
    font-size: 0.85rem; font-family: inherit;
    cursor: pointer; transition: all 0.15s;
}
.action-btn:hover { background: var(--surface2); color: var(--text); }
.action-btn.liked { color: var(--accent); }
.action-btn.liked:hover { background: var(--accentSoft); }
.action-btn .icon { font-size: 1.05rem; }
.action-btn .count { font-weight: 500; }

/* RIGHT SIDEBAR */
.sidebar-right { position: sticky; top: 74px; }

.search-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex; align-items: center;
    gap: 10px; padding: 10px 14px;
    margin-bottom: 14px;
}
.search-box input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text); font-size: 0.92rem; font-family: inherit;
}
.search-box input::placeholder { color: var(--text3); }
.search-box .icon { color: var(--text3); font-size: 0.95rem; }

.trending-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    padding: 16px;
}
.trending-title { font-weight: 700; font-size: 0.98rem; margin-bottom: 12px; }
.trending-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.trending-item:last-child { border-bottom: none; padding-bottom: 0; }
.trending-item:hover .trending-name { color: var(--accent); }
.trending-name { font-weight: 500; font-size: 0.9rem; margin-bottom: 2px; transition: color 0.15s; }
.trending-count { font-size: 0.78rem; color: var(--text3); }

.footer-links {
    margin-top: 14px;
    display: flex; flex-wrap: wrap;
    gap: 6px 14px;
}
.footer-links a {
    font-size: 0.78rem; color: var(--text3);
    transition: color 0.15s;
}
.footer-links a:hover { color: var(--text2); }

/* MODALS */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center; justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius2);
    width: 100%; max-width: 540px;
    max-height: 88vh; overflow-y: auto;
}
.modal-sm { max-width: 400px; }

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.05rem; }
.modal-close {
    background: none; border: none;
    color: var(--text2); font-size: 1.3rem;
    cursor: pointer; padding: 4px 8px;
    border-radius: 8px; transition: background 0.15s;
}
.modal-close:hover { background: var(--surface2); }

.modal-body { padding: 22px; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.88rem; color: var(--text2); margin-bottom: 7px; font-weight: 500; }
.form-input {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 11px 16px;
    color: var(--text);
    font-size: 0.93rem; font-family: inherit;
    transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--text3); }

.form-textarea {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--text);
    font-size: 0.95rem; font-family: inherit;
    resize: vertical; min-height: 100px;
    transition: border-color 0.2s;
}
.form-textarea:focus { outline: none; border-color: var(--accent); }

.btn-primary-full {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--accent); color: #fff;
    border: none; font-size: 0.98rem;
    font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.2s;
}
.btn-primary-full:hover { background: var(--accent2); box-shadow: 0 6px 20px rgba(255,77,79,0.3); }

.switch-link {
    text-align: center; margin-top: 14px;
    font-size: 0.88rem; color: var(--text2);
}
.switch-link a { color: var(--accent); cursor: pointer; }
.switch-link a:hover { text-decoration: underline; }

/* COMPOSE MODAL */
.compose-modal-top { display: flex; gap: 12px; margin-bottom: 14px; }
.compose-modal-images { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.compose-modal-images img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.compose-modal-toolbar { display: flex; gap: 6px; margin-bottom: 16px; }

/* COMMENT MODAL */
.comment-item {
    display: flex; gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-body { flex: 1; }
.comment-author { font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; }
.comment-text { font-size: 0.9rem; color: var(--text); line-height: 1.5; }
.comment-time { font-size: 0.75rem; color: var(--text3); margin-top: 4px; }
.comment-input-bar {
    display: flex; gap: 10px; align-items: center;
    padding: 14px 0 0;
    border-top: 1px solid var(--border);
}
.comment-input-bar .form-input { flex: 1; min-height: 40px; }
.btn-send {
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--accent); color: #fff;
    border: none; font-size: 0.88rem;
    font-weight: 600; cursor: pointer;
    font-family: inherit; transition: background 0.2s;
}
.btn-send:hover { background: var(--accent2); }

/* LOADING */
.loading-indicator {
    display: flex; justify-content: center; align-items: center;
    padding: 30px;
}
.spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--border2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center; padding: 60px 20px;
}
.empty-icon { font-size: 3rem; margin-bottom: 14px; }
.empty-state p { font-size: 1rem; color: var(--text2); }
.empty-sub { font-size: 0.88rem; color: var(--text3); margin-top: 6px; }

/* RESPONSIVE */
@media (max-width: 960px) {
    .main-wrapper { grid-template-columns: 1fr 260px; }
    .sidebar-left { display: none; }
}
@media (max-width: 700px) {
    .main-wrapper { grid-template-columns: 1fr; padding: 72px 12px 40px; }
    .sidebar-right { display: none; }
    .post-images.grid-1 img { max-height: 280px; }
    .post-images.grid-3 { grid-template-columns: 1fr; }
    .post-images.grid-3 img:first-child { height: 240px; }
    .post-images.grid-3 img:not(:first-child) { height: 160px; }
}
