/* Campus Tea — Desktop Social Platform */
:root {
    --primary: #7B2FF7;
    --primary-dark: #6229A7;
    --primary-darker: #4A148C;
    --secondary: #FF4D94;
    --accent: #FF7A00;
    --background: #F0F2F8;
    --surface: #FFFFFF;
    --border: #E4E7EF;
    --text-dark: #1A1A2E;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --sidebar-width: 220px;
    --right-sidebar-width: 260px;
    --topbar-height: 64px;
    --content-max: 780px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.06);
    --shadow-md: 0 4px 16px rgba(123, 47, 247, 0.1);
    --gradient-primary: linear-gradient(135deg, #7B2FF7 0%, #FF4D94 100%);
    --gradient-brand: linear-gradient(135deg, #6229A7 0%, #FF4D94 100%);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --topbar-bg: rgba(255, 255, 255, 0.92);
    --input-bg: var(--surface);
    --toggle-track: #E5E7EB;
    --toggle-thumb: #FFFFFF;
}

[data-theme="dark"] {
    color-scheme: dark;
    --background: #0f0d14;
    --surface: #1a1625;
    --border: #2d2640;
    --text-dark: #f1f0f5;
    --text-muted: #a89ec0;
    --text-light: #7a7194;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.45);
    --topbar-bg: rgba(26, 22, 37, 0.94);
    --input-bg: #221d30;
    --toggle-track: #3d3554;
    --toggle-thumb: #f1f0f5;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--font-family); background: var(--background); color: var(--text-dark); line-height: 1.5; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

.platform { display: flex; min-height: 100vh; }
.platform-main { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-left: var(--sidebar-width); }
.platform-body { flex: 1; padding: 24px 32px 48px; }

.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-width); height: 100vh; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 12px; z-index: 100; }
.sidebar-brand img { height: 44px; margin-bottom: 20px; padding-left: 4px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); font-size: 15px; font-weight: 600; color: var(--text-muted); transition: all 0.15s; }
.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(123, 47, 247, 0.06); color: var(--primary-dark); }
.sidebar-link.active { background: rgba(123, 47, 247, 0.1); color: var(--primary); }
.sidebar-link-cta.active { background: rgba(255, 77, 148, 0.1); color: var(--secondary); }
.sidebar-group { display: flex; flex-direction: column; gap: 2px; }
.sidebar-group-toggle {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
    border: none; border-radius: var(--radius-md); font-size: 15px; font-weight: 600;
    color: var(--text-muted); background: transparent; cursor: pointer; text-align: left;
    transition: all 0.15s;
}
.sidebar-group-toggle svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-group-toggle:hover { background: rgba(123, 47, 247, 0.06); color: var(--primary-dark); }
.sidebar-group-toggle.active { background: rgba(123, 47, 247, 0.1); color: var(--primary); }
.sidebar-group-chevron { margin-left: auto; width: 16px !important; height: 16px !important; transition: transform 0.2s; opacity: 0.6; }
.sidebar-group.is-open .sidebar-group-chevron { transform: rotate(180deg); }
.sidebar-group-items { display: none; flex-direction: column; gap: 2px; padding-left: 8px; }
.sidebar-group.is-open .sidebar-group-items { display: flex; }
.sidebar-link-nested { font-size: 14px; padding: 8px 12px; }
.sidebar-spill-btn { display: flex; align-items: center; justify-content: center; padding: 12px; background: var(--gradient-primary); color: white; font-weight: 700; font-size: 14px; border-radius: 999px; margin: 12px 4px; transition: transform 0.15s, box-shadow 0.2s; box-shadow: 0 4px 16px rgba(123, 47, 247, 0.3); }
.sidebar-spill-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(123, 47, 247, 0.4); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-md); background: var(--background); margin-top: auto; }
.sidebar-user-info { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user-info strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info span { font-size: 11px; color: var(--text-muted); }
.sidebar-login-link { display: block; text-align: center; padding: 10px; margin-top: auto; color: var(--primary); font-weight: 600; font-size: 13px; }
.sidebar-logout {
    display: block; width: calc(100% - 8px); margin: 8px 4px 0; padding: 9px 12px;
    text-align: center; font-size: 13px; font-weight: 600; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
    transition: background 0.15s, color 0.15s;
}
.sidebar-logout:hover { background: rgba(255, 77, 148, 0.08); color: #C2185B; border-color: rgba(255, 77, 148, 0.25); }

/* Shared user avatar */
.user-avatar {
    position: relative;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: #fff;
    line-height: 1;
}
.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.user-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.user-avatar--sm { width: 36px; height: 36px; font-size: 16px; }
.user-avatar--md { width: 44px; height: 44px; font-size: 18px; }
.user-avatar--lg { width: 88px; height: 88px; font-size: 34px; border: 2px solid var(--border); background: var(--background); }
.user-avatar--xl { width: 96px; height: 96px; font-size: 40px; border: 3px solid var(--primary); }
.compose-avatar .user-avatar { width: 48px; height: 48px; font-size: 22px; border: none; }
.sidebar-user .user-avatar { width: 36px; height: 36px; font-size: 16px; border: none; }

.topbar { position: sticky; top: 0; z-index: 50; height: var(--topbar-height); background: var(--topbar-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 20px; padding: 0 20px; }
.topbar-search { flex: 0 1 420px; min-width: 160px; display: flex; align-items: center; gap: 14px; background: var(--background); border: 1px solid var(--border); border-radius: 999px; padding: 14px 22px; transition: border-color 0.2s, box-shadow 0.2s; }
.topbar-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(123, 47, 247, 0.12); }
.topbar-search svg { width: 18px; height: 18px; color: var(--text-light); flex-shrink: 0; }
.topbar-search input { flex: 1; min-width: 0; border: none; background: none; font-family: inherit; font-size: 15px; color: var(--text-dark); outline: none; padding: 2px 0; }
.topbar-search input::placeholder { color: var(--text-light); }
.topbar-actions { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-evenly; gap: clamp(8px, 1.5vw, 20px); }
.topbar-actions > * { flex-shrink: 0; }
.topbar-campus { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--gradient-brand); color: white; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
.topbar-campus svg { width: 14px; height: 14px; }
.topbar-campus .chevron { opacity: 0.8; }
.topbar-hot { padding: 8px 14px; background: rgba(255,122,0,0.1); color: var(--accent); border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background 0.15s; }
.topbar-hot:hover { background: rgba(255,122,0,0.18); }
.topbar-icon-btn { position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--text-muted); transition: background 0.15s; }
.topbar-icon-btn:hover { background: var(--background); }
.topbar-icon-btn svg { width: 20px; height: 20px; }
.notification-badge .badge { position: absolute; top: 2px; right: 2px; background: var(--secondary); color: white; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); padding: 0 4px; }
.notification-badge .badge[hidden] { display: none !important; }
.topbar-notifications-menu.is-open .topbar-icon-btn { background: var(--background); color: var(--primary); }
.topbar-notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 210;
    overflow: hidden;
}
.topbar-notifications-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.topbar-notifications-head h3 { font-size: 15px; font-weight: 800; color: var(--text-dark); }
.topbar-notifications-mark-all {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
}
.topbar-notifications-mark-all:hover { text-decoration: underline; }
.topbar-notifications-list {
    list-style: none;
    max-height: 380px;
    overflow-y: auto;
}
.topbar-notifications-list li { border-bottom: 1px solid var(--border); }
.topbar-notifications-list li:last-child { border-bottom: none; }
.topbar-notification-item {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.topbar-notification-item:hover { background: var(--background); }
.topbar-notification-item.is-unread { background: rgba(123, 47, 247, 0.06); }
.topbar-notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.topbar-notification-body { flex: 1; min-width: 0; }
.topbar-notification-body p { font-size: 13px; line-height: 1.4; color: var(--text-dark); margin: 0; }
.topbar-notification-image {
    display: block; width: 100%; max-height: 120px; object-fit: cover;
    border-radius: 8px; margin-top: 8px; border: 1px solid var(--border);
}
.topbar-notification-body time { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }
.topbar-notifications-empty,
.topbar-notifications-loading {
    padding: 24px 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: none !important;
}
.topbar-profile { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); transition: background 0.15s, border-color 0.15s; background: transparent; cursor: pointer; font: inherit; color: inherit; text-decoration: none; }
.topbar-profile:hover { background: var(--background); border-color: var(--primary); }
.topbar-profile-trigger { min-height: 44px; }
.topbar-profile--guest { padding-right: 14px; }
.topbar-profile-guest-label { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.topbar-profile-chevron { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; transition: transform 0.2s; margin-left: 2px; }
.topbar-profile-menu { position: relative; flex-shrink: 0; }
.topbar-profile-menu.is-open .topbar-profile-chevron { transform: rotate(180deg); }
.topbar-profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 200;
}
.topbar-profile-dropdown-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.topbar-profile-dropdown-meta { min-width: 0; flex: 1; }
.topbar-profile-dropdown-name {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 2px;
}
.topbar-profile-dropdown-meta > span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}
.topbar-profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.topbar-profile-dropdown-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-muted); }
.topbar-profile-dropdown-item:hover { background: var(--background); }
.topbar-profile-dropdown-item--danger { color: #ef4444; }
.topbar-profile-dropdown-item--danger svg { color: #ef4444; }

.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--right-sidebar-width); gap: 24px; width: 100%; max-width: 1280px; margin: 0 auto; align-items: start; }
.feed-center { min-width: 0; }

.compose-box { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.compose-avatar { flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.compose-body { flex: 1; min-width: 0; }
.compose-input { display: block; width: 100%; padding: 12px 0; font-size: 17px; color: var(--text-light); border-bottom: 1px solid var(--border); margin-bottom: 14px; transition: color 0.15s; }
.compose-input:hover { color: var(--text-muted); }
.compose-actions { display: flex; justify-content: flex-end; }

.category-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 16px; scrollbar-width: none; }
.category-strip::-webkit-scrollbar { display: none; }
.category-strip-item { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; transition: all 0.15s; }
.category-strip-item:hover { border-color: var(--primary); color: var(--primary); }
.category-strip-item.active { background: var(--primary); border-color: var(--primary); color: white; }
.category-strip-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--background); }
.category-strip-item.active .category-strip-icon { background: rgba(255,255,255,0.2); }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.filter-bar--feed { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 12px; }
.filter-bar--feed::-webkit-scrollbar { display: none; }
.filter-tab { padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); transition: all 0.15s; white-space: nowrap; flex-shrink: 0; }
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active { background: var(--primary); border-color: var(--primary); color: white; }
.filter-tab--action { background: rgba(123, 47, 247, 0.1); border-color: rgba(123, 47, 247, 0.35); color: var(--primary); }
.filter-tab--action:hover { background: rgba(123, 47, 247, 0.16); }

.feed { display: flex; flex-direction: column; gap: 16px; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; transition: box-shadow 0.2s, border-color 0.2s; }
.post-card:hover { box-shadow: var(--shadow-md); border-color: rgba(123, 47, 247, 0.15); }
.post-card.highlight { border-color: rgba(255, 77, 148, 0.25); background: linear-gradient(135deg, rgba(255,77,148,0.03) 0%, rgba(123,47,247,0.03) 100%); }
.post-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.post-user { display: flex; align-items: center; gap: 12px; }
.post-user-link {
    display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
    text-decoration: none; color: inherit; border-radius: 10px;
    transition: background 0.15s;
}
.post-user-link:hover { background: var(--background); }
.post-user-link:hover .post-author-name { color: var(--primary); }
.post-avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; overflow: hidden; }
.post-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; border-radius: 50%; }
.post-avatar.anonymous { background: linear-gradient(135deg, #FFD600, #FF7A00); }
.post-avatar.user { background: linear-gradient(135deg, #7B2FF7, #448AFF); }
.post-meta h4 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.post-meta-info { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.post-meta-info .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-light); }
.post-meta-category { font-weight: 600; }
.post-actions-top { display: flex; align-items: center; gap: 8px; }
.trending-badge { background: rgba(255,122,0,0.12); color: var(--accent); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.post-menu-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--text-muted); font-size: 18px; }
.post-menu-btn:hover { background: var(--background); }
.post-content { font-size: 16px; line-height: 1.65; color: var(--text-dark); margin-bottom: 14px; }
.post-repost-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin: 0 0 8px; }
.post-repost-source { margin: 0 0 14px; padding: 14px 16px; border-left: 3px solid var(--primary); background: var(--surface-2, rgba(123, 47, 247, 0.06)); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.post-repost-source p { margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: var(--text-dark); }
.feed-ad-slot { margin: 16px 0; padding: 12px; border-radius: var(--radius-md); background: var(--surface); border: 1px dashed var(--border); min-height: 90px; display: flex; align-items: center; justify-content: center; }
.site-ad-banner { margin: 24px auto 16px; max-width: 728px; padding: 12px; border-radius: var(--radius-md); background: var(--surface); border: 1px dashed var(--border); min-height: 90px; display: flex; align-items: center; justify-content: center; }
.post-image { margin-bottom: 14px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.post-image img { width: 100%; max-height: 480px; object-fit: cover; display: block; }

.post-audio {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--background);
}
.post-audio-label { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--text-muted); }
.post-audio audio { width: 100%; height: 40px; }

.voice-note-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.voice-note-zone.is-recording { border-color: #ef4444; background: rgba(239, 68, 68, 0.04); }
.voice-note-zone.has-audio { border-style: solid; border-color: var(--primary); background: rgba(123, 47, 247, 0.04); }
.voice-note-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.voice-note-timer { font-size: 14px; font-weight: 700; color: #ef4444; margin-top: 8px; }
.voice-note-preview audio { width: 100%; margin-top: 12px; }

.image-upload-wrap input[type="file"] { width: 100%; font-size: 14px; }
.image-upload-zone { border: 2px dashed var(--border); border-radius: var(--radius-md); overflow: hidden; transition: border-color 0.15s, background 0.15s; }
.image-upload-zone:hover { border-color: var(--primary); background: rgba(123, 47, 247, 0.04); }
.image-upload-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 16px; text-align: center; cursor: pointer; }
.image-upload-icon { font-size: 28px; line-height: 1; }
.image-upload-name { font-size: 13px; color: var(--text-muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-optional { font-weight: 500; color: var(--text-muted); font-size: 13px; }
.identity-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 20px;
    padding: 0;
    border: none;
}
.identity-picker-legend {
    grid-column: 1 / -1;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
    padding: 0;
}
.identity-picker-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.identity-picker-option:hover { border-color: rgba(123, 47, 247, 0.35); }
.identity-picker-option.is-selected {
    border-color: var(--primary);
    background: rgba(123, 47, 247, 0.06);
    box-shadow: 0 0 0 1px rgba(123, 47, 247, 0.12);
}
.identity-picker-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.identity-picker-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD600, #FF7A00);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.identity-picker-icon-user {
    background: var(--background);
    border: 1px solid var(--border);
    overflow: hidden;
}
.identity-picker-icon-user .user-avatar { width: 100%; height: 100%; }
.identity-picker-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.identity-picker-body strong { font-size: 14px; font-weight: 800; color: var(--text-dark); line-height: 1.3; }
.identity-picker-body span:last-child { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
@media (max-width: 520px) {
    .identity-picker { grid-template-columns: 1fr; }
}
.image-upload-preview { position: relative; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.image-upload-preview img { width: 100%; max-height: 240px; object-fit: cover; display: block; }
.image-upload-clear { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.6); color: white; font-size: 20px; line-height: 1; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.profile-msg-btn {
    display: inline-flex; align-items: center; gap: 6px;
}
.profile-msg-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.post-category-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px solid transparent; margin-bottom: 16px; }
.post-reactions { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.reaction-btn { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--background); font-size: 14px; transition: all 0.15s; border: 1px solid transparent; }
.reaction-btn:hover { background: rgba(123,47,247,0.08); border-color: rgba(123,47,247,0.2); transform: translateY(-1px); }
.reaction-btn.is-active { background: rgba(123,47,247,0.15); border-color: rgba(123,47,247,0.35); }
.reaction-btn.is-active .count { color: var(--primary); }
.reaction-btn .emoji { font-size: 16px; }
.reaction-btn .count { font-weight: 700; color: var(--text-muted); font-size: 13px; }
.post-footer { display: flex; align-items: center; gap: 8px; }
.post-action-btn { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--text-muted); transition: all 0.15s; }
.post-action-btn svg { width: 18px; height: 18px; }
.post-action-btn:hover { background: rgba(123,47,247,0.08); color: var(--primary); }
.post-shares { margin-left: auto; font-size: 13px; color: var(--text-light); }

.share-wrap { position: relative; }
.share-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 210px;
    z-index: 30;
    overflow: hidden;
}
.share-menu[hidden] { display: none !important; }
.share-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}
.share-menu button:hover { background: var(--background); }

.comments-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.comments-panel[hidden] { display: none !important; }
.comments-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.comments-panel-head h4 { font-size: 15px; font-weight: 700; }
.comments-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}
.comments-close:hover { background: var(--background); color: var(--text-dark); }
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 14px;
}
.comment-item {
    padding: 12px 14px;
    background: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.comment-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}
.comment-item-head strong { font-weight: 700; color: var(--text-dark); }
.comment-author-link {
    text-decoration: none; color: inherit; border-radius: 4px;
    transition: color 0.15s;
}
.comment-author-link:hover { color: var(--primary); }
.comment-author-link:hover .comment-author-name { color: var(--primary); }
.comment-item-head span { color: var(--text-light); font-size: 12px; }
.comment-item p { font-size: 14px; line-height: 1.5; color: var(--text-dark); }
.comments-empty, .comments-loading, .comments-login-hint {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 16px;
}
.comments-login-hint a { color: var(--primary); font-weight: 600; }
.comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-dark);
    resize: vertical;
    min-height: 72px;
}
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(123, 47, 247, 0.1);
}
.comment-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 12px;
}
.comment-anon-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

.right-sidebar { position: sticky; top: calc(var(--topbar-height) + 24px); display: flex; flex-direction: column; gap: 12px; width: var(--right-sidebar-width); flex-shrink: 0; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; box-shadow: var(--shadow-sm); }
.widget-title { font-size: 14px; font-weight: 800; margin-bottom: 10px; color: var(--text-dark); }
.widget-campus { padding: 0; overflow: hidden; }
.widget-campus-banner { display: flex; align-items: center; gap: 10px; padding: 14px; background: var(--gradient-brand); color: white; }
.widget-campus-icon { font-size: 22px; }
.widget-campus-banner h3 { font-size: 14px; font-weight: 800; }
.widget-campus-banner p { font-size: 11px; opacity: 0.85; }
.widget-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 12px 8px; gap: 4px; }
.widget-stats strong { display: block; font-size: 15px; color: var(--primary); }
.widget-stats span { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.trending-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.trending-list li a { display: flex; gap: 8px; padding: 8px; border-radius: var(--radius-sm); transition: background 0.15s; }
.trending-list li a:hover { background: var(--background); }
.trending-rank { font-size: 13px; font-weight: 800; color: var(--primary); min-width: 18px; }
.trending-cat { font-size: 10px; font-weight: 700; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.trending-info p { font-size: 13px; font-weight: 600; line-height: 1.35; margin: 2px 0; color: var(--text-dark); }
.trending-meta { font-size: 11px; color: var(--text-light); }
.widget-link { display: block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--primary); }
.category-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.category-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; background: var(--background); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text-muted); transition: all 0.15s; }
.widget-promo-inner { text-align: center; padding: 4px 0; }
.widget-promo-emoji { font-size: 28px; display: block; margin-bottom: 6px; }
.widget-promo h4 { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.widget-promo p { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.group-widget-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.group-widget-item a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); transition: background 0.15s; }
.group-widget-item a:hover { background: var(--background); }
.group-widget-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--gradient-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; flex-shrink: 0; }
.group-widget-info strong { display: block; font-size: 13px; color: var(--text-dark); }
.group-widget-info span { font-size: 11px; color: var(--text-muted); }
.widget-empty-text { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.widget-link:hover { text-decoration: underline; }
.sidebar-footer { padding: 8px 4px; font-size: 11px; color: var(--text-light); display: flex; flex-direction: column; gap: 4px; }

.btn-primary { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; background: var(--gradient-primary); color: white; font-weight: 700; font-size: 15px; border-radius: 999px; border: none; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; background: var(--background); color: var(--primary); font-weight: 700; font-size: 14px; border-radius: 999px; border: 1px solid var(--border); transition: all 0.15s; }
.btn-secondary:hover { border-color: var(--primary); background: rgba(123,47,247,0.06); }
.btn-sm { padding: 8px 18px; font-size: 14px; }
.btn-full { width: 100%; }

.page-layout { max-width: 1200px; margin: 0 auto; }
.page-layout-narrow { max-width: 640px; }
.page-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); }
.page-card-header { margin-bottom: 28px; }
.page-card-header h1 { font-size: 28px; font-weight: 800; margin: 8px 0; color: var(--text-dark); }
.page-card-header p { color: var(--text-muted); font-size: 15px; }
.page-back { font-size: 14px; font-weight: 600; color: var(--primary); }
.page-back:hover { text-decoration: underline; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); font-family: inherit; font-size: 15px; background: var(--input-bg); color: var(--text-dark); transition: border-color 0.2s, box-shadow 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(123,47,247,0.12); }
.form-group textarea { resize: vertical; min-height: 140px; }
.toggle-group { background: var(--background); padding: 16px; border-radius: var(--radius-md); }
.toggle-label { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle-label input { display: none; }
.toggle-switch { width: 48px; height: 28px; background: var(--toggle-track); border-radius: 14px; position: relative; flex-shrink: 0; transition: background 0.2s; }
.toggle-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: var(--toggle-thumb); border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-label input:checked + .toggle-switch { background: var(--primary); }
.toggle-label input:checked + .toggle-switch::after { transform: translateX(20px); }
.toggle-text strong { display: block; font-size: 14px; }
.toggle-text small { color: var(--text-muted); font-size: 12px; }

.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--background); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-md); }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo img { height: 64px; margin: 0 auto 12px; }
.auth-logo p { color: var(--text-muted); font-size: 14px; }
.auth-hint { margin-top: 16px; font-size: 13px; color: var(--text-muted); text-align: center; }
.auth-back { display: block; margin-top: 20px; text-align: center; color: var(--primary); font-weight: 600; font-size: 14px; }
.auth-notice { text-align: center; padding: 24px; background: var(--background); border-radius: var(--radius-md); }
.auth-notice p { margin-bottom: 16px; color: var(--text-muted); }
.auth-notice .hint { margin-top: 12px; font-size: 13px; color: var(--text-light); }

.toast { padding: 14px 18px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; margin-bottom: 16px; animation: slideDown 0.3s ease; }
.toast-success { background: rgba(123,47,247,0.1); color: var(--primary-dark); border: 1px solid rgba(123,47,247,0.2); }
.toast-error { background: rgba(255,77,148,0.1); color: #C2185B; border: 1px solid rgba(255,77,148,0.2); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.empty-state { text-align: center; padding: 64px 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; }

.gradient-pink-purple { background: linear-gradient(135deg, #FF4D94, #7B2FF7) !important; color: white; }
.gradient-orange-pink { background: linear-gradient(135deg, #FF7A00, #FF4D94) !important; color: white; }
.gradient-pink-red { background: linear-gradient(135deg, #FF4D94, #FF1744) !important; color: white; }
.gradient-purple-blue { background: linear-gradient(135deg, #7B2FF7, #448AFF) !important; color: white; }
.gradient-purple-pink { background: linear-gradient(135deg, #7B2FF7, #FF4D94) !important; color: white; }
.gradient-yellow-orange { background: linear-gradient(135deg, #FFD600, #FF7A00) !important; color: white; }
.category-strip-icon.all { background: var(--gradient-primary) !important; color: white; }

/* School picker & feed banner */
.school-picker-form { margin: 0; }
.school-picker { display: flex; align-items: center; gap: 6px; }
.school-picker select {
    background: transparent; border: none; color: white; font-weight: 600; font-size: 13px;
    font-family: inherit; cursor: pointer; outline: none; max-width: 140px;
}
.school-picker select option { color: var(--text-dark); background: var(--surface); }
.topbar-campus-limit {
    margin: 4px 0 0;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}
.school-feed-banner {
    display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(98,41,167,0.08), rgba(255,77,148,0.08));
    border: 1px solid rgba(123,47,247,0.2); border-radius: var(--radius-lg);
}
.school-feed-icon { font-size: 28px; }
.school-feed-banner strong { display: block; font-size: 16px; }
.school-feed-banner span { font-size: 13px; color: var(--text-muted); }
.school-feed-banner a { color: var(--primary); font-weight: 600; }
.school-feed-type { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--primary); background: rgba(123,47,247,0.1); padding: 6px 12px; border-radius: 999px; }

/* Registration */
.register-page { max-width: 720px; margin: 0 auto; }
.register-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-md); }
.register-header { text-align: center; margin-bottom: 32px; }
.register-header img { height: 56px; margin: 0 auto 12px; }
.register-header h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.register-header p { color: var(--text-muted); font-size: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.form-section-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--primary-dark); }
.register-form .auth-hint { text-align: center; margin-top: 20px; }
.register-form .auth-hint a { color: var(--primary); font-weight: 700; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }

/* Theme toggle — fixed when standalone; inline in topbar on main layout */
.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s, border-color 0.2s;
}

.topbar .theme-toggle {
    position: static;
    top: auto;
    right: auto;
    z-index: 1;
    width: 40px;
    height: 40px;
    box-shadow: none;
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: rgba(123, 47, 247, 0.35);
    transform: scale(1.05);
}

.theme-toggle-icon {
    width: 20px;
    height: 20px;
    position: absolute;
    transition: opacity 0.2s, transform 0.25s;
}

[data-theme="light"] .theme-toggle-moon,
[data-theme="dark"] .theme-toggle-sun {
    opacity: 0;
    transform: rotate(30deg) scale(0.5);
    pointer-events: none;
}

[data-theme="light"] .theme-toggle-sun,
[data-theme="dark"] .theme-toggle-moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

@media (min-width: 1400px) {
    :root { --sidebar-width: 220px; --right-sidebar-width: 280px; }
    .feed-layout { max-width: 1360px; gap: 28px; }
    .platform-body { padding: 32px 48px 64px; }
}
@media (max-width: 1100px) {
    :root { --right-sidebar-width: 240px; }
    .feed-layout { gap: 20px; max-width: 100%; }
    .topbar-hot { display: none; }
    .topbar-actions { justify-content: space-between; gap: 10px; }
}
@media (max-width: 900px) {
    .right-sidebar { display: none; }
    .feed-layout { grid-template-columns: 1fr; max-width: 720px; }
    .topbar { padding: 0 12px; gap: 12px; }
    .topbar-search { flex: 1; min-width: 0; padding: 10px 14px; }
    .topbar-actions { justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
    .topbar-campus-ai { display: none; }
}

/* Verified badge — site-wide */
.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: #1d9bf0;
    color: #fff;
    vertical-align: middle;
}
.verified-badge--sm { width: 16px; height: 16px; margin-left: 4px; }
.verified-badge--md { width: 20px; height: 20px; margin-left: 6px; }
.verified-badge svg { width: 62%; height: 62%; display: block; }

/* Tea streak badges */
.tea-streak-badge {
    display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
    border-radius: 999px; font-weight: 800; vertical-align: middle;
    border: 1px solid transparent;
}
.tea-streak-badge--sm { font-size: 10px; padding: 2px 7px; margin-left: 4px; }
.tea-streak-badge--md { font-size: 11px; padding: 3px 9px; margin-left: 6px; }
.tea-streak-badge--lg { font-size: 13px; padding: 6px 12px; }
.tea-streak-badge--chip { font-size: 11px; padding: 4px 10px; }
.tea-streak-badge-icon { line-height: 1; }
.tea-streak-badge--rookie { background: rgba(148, 163, 184, 0.15); color: #475569; border-color: rgba(148, 163, 184, 0.25); }
.tea-streak-badge--tea_spiller { background: rgba(16, 185, 129, 0.12); color: #047857; border-color: rgba(16, 185, 129, 0.25); }
.tea-streak-badge--gistlord { background: rgba(255, 122, 0, 0.12); color: #C2410C; border-color: rgba(255, 122, 0, 0.25); }
.tea-streak-badge--campus_legend { background: rgba(255, 193, 7, 0.15); color: #B45309; border-color: rgba(255, 193, 7, 0.35); }

/* Campus title badges */
.campus-title-badge {
    display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
    border-radius: 999px; font-weight: 800; vertical-align: middle;
    border: 1px solid transparent;
}
.campus-title-badge--sm { font-size: 10px; padding: 2px 7px; margin-left: 4px; }
.campus-title-badge--md { font-size: 11px; padding: 3px 9px; margin-left: 6px; }
.campus-title-badge--lg { font-size: 13px; padding: 6px 12px; }
.campus-title-badge-icon { line-height: 1; }
.campus-title-badge--tea_rookie { background: rgba(120, 113, 108, 0.12); color: #57534e; border-color: rgba(120, 113, 108, 0.2); }
.campus-title-badge--tea_spiller { background: rgba(14, 165, 233, 0.12); color: #0369a1; border-color: rgba(14, 165, 233, 0.25); }
.campus-title-badge--gistlord { background: rgba(255, 122, 0, 0.12); color: #C2410C; border-color: rgba(255, 122, 0, 0.25); }
.campus-title-badge--campus_insider { background: rgba(255, 193, 7, 0.15); color: #B45309; border-color: rgba(255, 193, 7, 0.35); }
.campus-title-badge--agent_of_chaos { background: rgba(15, 23, 42, 0.12); color: #0f172a; border-color: rgba(15, 23, 42, 0.2); }

.post-author-name,
.profile-name,
.sidebar-user-name,
.topbar-profile-dropdown-name,
.chat-peer-name,
.comment-author-name {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}
