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

:root {
    --primary-color: #990000;
    --primary-hover: #cc0000;
    --secondary-color: #666;
    --bg-color: #f5f5f5;
    --white: #ffffff;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --error-color: #f44336;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.view {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* 登录界面 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px 30px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.login-container-inline {
    padding: 20px;
    background: var(--white);
    border-radius: 12px;
    margin: 20px;
    box-shadow: var(--shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form input {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

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

.btn-primary {
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 12px 24px;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.error-message {
    margin-top: 16px;
    padding: 12px;
    background: #ffebee;
    color: var(--error-color);
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

/* 导航栏 */
.navbar {
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar h2 {
    font-size: 20px;
    color: var(--text-primary);
}

.navbar-actions {
    display: flex;
    gap: 12px;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

.icon-btn:hover {
    background: var(--bg-color);
}

/* 搜索栏 */
.search-container {
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.search-container input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
}

/* 百科搜索输入框 */
.baike-search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    box-sizing: border-box;
}

.search-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--primary-hover);
}

.cancel-search-btn {
    padding: 10px 16px;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

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

/* 对话列表 */
.conversations-container {
    flex: 1;
    overflow-y: auto;
}

.conversations-list {
    background: var(--white);
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.conversation-item:hover {
    background: var(--bg-color);
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.conversation-avatar.group {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

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

.conversation-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-left: 12px;
}

.conversation-time {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.conversation-unread {
    background: var(--primary-color);
    color: var(--white);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

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

.empty-hint {
    font-size: 14px;
    margin-top: 8px;
    opacity: 0.7;
}

/* 聊天界面 */
.chat-header {
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    color: var(--primary-color);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 18px;
    flex-shrink: 0;
}

.chat-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.chat-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 消息列表 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-color);
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 75%;
}

.message-item.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    word-wrap: break-word;
    position: relative;
}

.message-item.own .message-bubble {
    background: var(--primary-color);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.message-item.other .message-bubble {
    background: var(--white);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-sender {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    padding: 0 4px;
}

.message-item.own .message-sender {
    text-align: right;
}

.message-time {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
    padding: 0 4px;
}

.message-item.other .message-time {
    color: var(--text-secondary);
}

/* iMessage 风格消息样式 */
.chat-message-row {
    display: flex;
    margin: 4px 8px;
}

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

.chat-message-row-other {
    justify-content: flex-start;
}

.chat-message-bubble {
    max-width: 70%;
    padding: 8px 10px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.chat-message-bubble-own {
    background-color: #0b93f6;
    color: #ffffff;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 18px;
}

.chat-message-bubble-other {
    background-color: #e5e5ea;
    color: #000000;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 18px;
}

.chat-message-sender {
    font-size: 12px;
    margin-bottom: 2px;
    opacity: 0.8;
}

.chat-message-time {
    font-size: 11px;
    margin-top: 2px;
    opacity: 0.6;
    text-align: right;
}

.chat-message-bubble-other .chat-message-time {
    text-align: left;
}

/* 输入栏 */
.chat-input-container {
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
}

.chat-input-container input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 15px;
}

.send-btn {
    padding: 10px 24px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

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

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

.modal-header h3 {
    font-size: 20px;
    color: var(--text-primary);
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:hover {
    background: var(--bg-color);
}

.modal-body {
    padding: 20px;
}

.modal-body input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 16px;
}

.group-members-section {
    margin-top: 20px;
}

.group-members-section h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.selected-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    min-height: 40px;
    padding: 8px;
    background: var(--bg-color);
    border-radius: 8px;
}

.member-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 16px;
    font-size: 14px;
}

.member-tag .remove-btn {
    background: transparent;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-list {
    max-height: 300px;
    overflow-y: auto;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.member-item:hover {
    background: var(--bg-color);
}

.member-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 16px;
}

.member-info {
    flex: 1;
}

.member-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
    flex: 1;
    max-width: 120px;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 22px;
}

.nav-label {
    font-size: 12px;
}

/* 标签页内容 */
.tab-content {
    display: none;
    padding-bottom: 60px; /* 为底部导航留出空间 */
    min-height: calc(100vh - 60px);
}

.tab-content.active {
    display: block;
}

/* 首页样式 */
.home-header {
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.home-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-placeholder {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.home-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.user-welcome {
    font-size: 14px;
    color: var(--text-secondary);
}

.header-divider {
    height: 3px;
    background: var(--primary-color);
}

.posts-container {
    background: var(--bg-color);
    min-height: calc(100vh - 120px);
    padding: 16px;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* FIX(feed): 帖子卡片基础样式与等高布局 */
.post-card {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 200px; /* 统一最小高度，确保等高 */
    display: flex;
    flex-direction: column;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.post-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.post-author {
    font-size: 14px;
    color: var(--text-secondary);
}

.post-content {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 12px;
}

/* FIX(feed): 帖子卡片内部容器 */
.post-card-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-content-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex: 1;
}

/* FIX(feed): 帖子摘要文本（多行截断，保留换行显示） */
.post-content-excerpt {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 电脑端显示2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.6em * 2); /* 2行的高度 */
    white-space: pre-line; /* 保留换行，合并空格 */
    word-break: break-word; /* 长单词换行 */
}

/* FIX(feed): 手机端摘要更短（响应式） */
@media (max-width: 768px) {
    .post-content-excerpt {
        -webkit-line-clamp: 2; /* 手机端也显示2行 */
        max-height: calc(1.6em * 2);
        font-size: 14px; /* 手机端字体稍小 */
    }
}

/* FIX(feed): 帖子缩略图样式 */
.post-thumbnail {
    width: 140px;
    height: 110px;
    max-width: 140px;
    max-height: 110px;
    border-radius: 8px;
    background: var(--bg-color);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 4px;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.post-thumbnail-placeholder {
    background: var(--bg-color);
    border: 1px dashed var(--border-color);
}

.post-thumbnail-empty {
    color: var(--text-secondary);
    font-size: 12px;
}

/* FIX(feed): 详情页完整内容样式 - 保留换行和段落 */
.post-content-full {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 12px;
    word-wrap: break-word;
    word-break: break-word; /* 长单词换行 */
    white-space: normal; /* 正常换行，依靠<br>标签 */
}

/* 帖子内容中的换行标签样式 */
.post-content-full br {
    display: block;
    margin: 0.4em 0; /* 段落间距 */
    content: '';
    line-height: 1.8;
}

.post-content-full img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

/* 帖子图片预览 */
.post-image-preview {
    position: relative;
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
    max-height: 200px;
}

.post-image-preview img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.post-image-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* 帖子详情图片 */
.post-detail-images {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-detail-image-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.post-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.post-badge.pinned {
    background: #ffd700;
    color: #333;
}

.post-badge.admin {
    background: var(--primary-color);
    color: var(--white);
}

.post-badge.pending {
    background: #ff9800;
    color: var(--white);
}

/* 浮动按钮 */
.float-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.float-btn:hover {
    background: var(--primary-hover);
}

/* 审核标签页 */
.review-tabs {
    display: flex;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.review-tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s;
}

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

/* 用户统计 */
.users-stats {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--white);
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 16px;
    background: var(--bg-color);
    border-radius: 12px;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.users-container {
    padding: 16px;
    background: var(--bg-color);
    min-height: calc(100vh - 200px);
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-card {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
}

.user-card-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-card-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-left: 8px;
}

.user-card-badge.admin {
    background: var(--primary-color);
    color: var(--white);
}

/* 个人中心 */
.profile-container {
    padding: 20px;
    background: var(--bg-color);
    min-height: calc(100vh - 120px);
}

.profile-header {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px;
    font-weight: bold;
}

.profile-username {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-email {
    font-size: 14px;
    color: var(--text-secondary);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-action-btn {
    padding: 14px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-action-btn:hover {
    background: var(--bg-color);
}

.profile-action-btn.danger {
    color: var(--error-color);
    border-color: var(--error-color);
}

.profile-action-btn.danger:hover {
    background: var(--error-color);
    color: var(--white);
}

/* 全屏视图 */
.fullscreen-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background: var(--white);
}

/* 评论区域 */
.comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* 百科详情内容 */
.wiki-detail-content {
    line-height: 1.8;
    color: var(--text-primary);
}

.wiki-detail-content h1,
.wiki-detail-content h2,
.wiki-detail-content h3,
.wiki-detail-content h4,
.wiki-detail-content h5,
.wiki-detail-content h6 {
    margin: 16px 0 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.wiki-detail-content p {
    margin: 12px 0;
    line-height: 1.8;
}

.wiki-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 12px 0;
}

.wiki-detail-content ul,
.wiki-detail-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.wiki-detail-content li {
    margin: 8px 0;
}

.wiki-detail-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 百科条目卡片 */
.baike-item {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.baike-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.baike-item:active {
    transform: translateY(0);
}

.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-author {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.comment-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.comment-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 大模态框 */
.modal-content.large {
    max-width: 90%;
    max-height: 85vh;
}

/* 图片上传区域 */
.image-upload-section {
    margin: 16px 0;
}

.image-upload-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--bg-color);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    color: var(--text-primary);
    font-size: 14px;
}

.image-upload-btn:hover {
    background: var(--white);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.selected-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

.image-preview-item .remove-image-btn:hover {
    background: rgba(255, 0, 0, 0.8);
}

/* 随机聊天按钮容器 */
.random-chat-button-container {
    background: var(--white);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.random-chat-btn {
    width: 100%;
    min-width: 200px;
    min-height: 48px;
    padding: 14px 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.random-chat-btn:hover {
    background: var(--primary-hover);
}

.random-chat-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: inline-block;
}

.random-chat-text {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .login-container {
        margin: 40px 20px;
        padding: 30px 20px;
    }

    .conversation-item {
        padding: 10px 12px;
    }

    .chat-input-container {
        padding: 10px 12px;
    }

    .bottom-nav {
        padding: 6px 0;
    }

    .nav-icon {
        font-size: 20px;
    }

    .nav-label {
        font-size: 11px;
    }

    .float-btn {
        bottom: 70px;
        width: 56px;
        height: 56px;
    }
    
    .random-chat-btn {
        padding: 16px 20px;
        font-size: 18px;
        min-height: 52px;
    }
    
    .random-chat-icon {
        font-size: 22px;
    }
    
    .random-chat-text {
        font-size: 18px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

