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

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    color: white;
    opacity: 0.9;
    font-weight: 500;
}

.nav a:hover, .nav a.active {
    opacity: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 8px 15px;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 200px;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-primary {
    background: white;
    color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    border: 1px solid white;
    color: white;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

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

.user-avatar .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 10px 0;
    display: none;
    margin-top: 10px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 10px 20px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--light);
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}

.main {
    padding: 30px 0;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 25px;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    font-size: 16px;
}

.card-body {
    padding: 20px;
}

.category-list {
    list-style: none;
}

.category-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-item:hover {
    background: var(--light);
}

.category-item:last-child {
    border-bottom: none;
}

.category-name {
    font-weight: 500;
}

.category-stats {
    color: var(--gray);
    font-size: 13px;
}

.post-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.post-item:hover {
    background: #fafafa;
}

.post-item:last-child {
    border-bottom: none;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
}

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

.post-meta {
    flex: 1;
}

.post-author {
    font-weight: 500;
}

.post-time {
    color: var(--gray);
    font-size: 13px;
}

.post-tags {
    display: flex;
    gap: 8px;
}

.tag {
    background: var(--light);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--gray);
}

.tag.essence {
    background: #fef3c7;
    color: #92400e;
}

.tag.top {
    background: #fee2e2;
    color: #991b1b;
}

.post-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1f2937;
}

.post-summary {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.post-footer {
    display: flex;
    align-items: center;
    gap: 25px;
    color: var(--gray);
    font-size: 13px;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: color 0.2s;
}

.post-action:hover, .post-action.active {
    color: var(--primary);
}

.sidebar-section {
    margin-bottom: 25px;
}

.user-card {
    text-align: center;
    padding: 25px;
}

.user-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 28px;
    font-weight: 600;
}

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

.user-card-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.user-card-level {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 15px;
}

.user-card-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.user-stat {
    text-align: center;
}

.user-stat-num {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

.user-stat-label {
    color: var(--gray);
    font-size: 13px;
}

.hot-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 12px;
}

.hot-item:last-child {
    border-bottom: none;
}

.hot-rank {
    width: 24px;
    height: 24px;
    background: var(--light);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.hot-rank.top3 {
    background: var(--primary);
    color: white;
}

.hot-content {
    flex: 1;
    overflow: hidden;
}

.hot-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.hot-meta {
    color: var(--gray);
    font-size: 12px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.btn-group {
    display: flex;
    gap: 12px;
}

.btn-ghost {
    background: var(--light);
    color: #333;
}

.btn-ghost:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.post-detail-header {
    padding: 25px;
    border-bottom: 1px solid #eee;
}

.post-detail-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-detail-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.post-detail-content {
    padding: 25px;
    font-size: 16px;
    line-height: 1.8;
}

.post-detail-actions {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 20px;
}

.comment-section {
    margin-top: 25px;
}

.comment-form {
    padding: 20px;
    background: var(--light);
    border-radius: 8px;
    margin-bottom: 20px;
}

.comment-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
}

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

.comment-content {
    margin-bottom: 10px;
    line-height: 1.6;
}

.comment-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--gray);
    font-size: 13px;
}

.comment-reply {
    margin-left: 48px;
    margin-top: 15px;
    padding-left: 15px;
    border-left: 3px solid var(--light);
}

.reply-form {
    margin-top: 10px;
    display: none;
}

.reply-form.show {
    display: block;
}

.profile-section {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 25px;
}

.profile-cover {
    height: 180px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    position: relative;
}

.profile-info {
    padding: 0 25px 25px;
    position: relative;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid white;
    background: var(--light);
    position: absolute;
    top: -60px;
    left: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 600;
    color: var(--primary);
}

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

.profile-content {
    padding-top: 70px;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.profile-bio {
    color: var(--gray);
    margin-bottom: 15px;
}

.profile-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    background: white;
}

.profile-tab {
    padding: 15px 25px;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.profile-tab:hover {
    color: var(--primary);
}

.profile-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.profile-pane {
    display: none;
}

.profile-pane.active {
    display: block;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.empty-text {
    font-size: 16px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 25px;
}

.pagination-btn {
    padding: 10px 18px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover, .pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.message-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.message-item:hover {
    background: #fafafa;
}

.message-item.unread {
    background: #f0f7ff;
}

.message-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.message-content {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 5px;
}

.message-time {
    color: var(--gray);
    font-size: 12px;
}

.conversation-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    gap: 12px;
    transition: background 0.2s;
}

.conversation-item:hover {
    background: #fafafa;
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}

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

.conversation-content {
    flex: 1;
    min-width: 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.conversation-name {
    font-weight: 500;
}

.conversation-time {
    color: var(--gray);
    font-size: 12px;
}

.conversation-preview {
    color: var(--gray);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-messages {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.chat-message {
    display: flex;
    margin-bottom: 15px;
}

.chat-message.sent {
    justify-content: flex-end;
}

.chat-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--light);
}

.chat-message.sent .chat-message-content {
    background: var(--primary);
    color: white;
}

.chat-message-time {
    font-size: 11px;
    color: var(--gray);
    margin-top: 5px;
    text-align: right;
}

.chat-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eee;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    outline: none;
}

.chat-input button {
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .nav {
        display: none;
    }
    
    .search-box input {
        width: 120px;
    }
}
