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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    position: relative;
}

/* 头部 */
.header {
    position: fixed;
    top: 0;
    max-width: 480px;
    width: 100%;
    height: 50px;
    background: #fff;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 100;
}

.menu-btn {
    font-size: 24px;
    cursor: pointer;
    width: 40px;
}

.logo {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

.user-btn {
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.header-spacer {
    width: 40px;
    height: 40px;
}

.avatar-small {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

/* 侧边栏 */
.sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.sidebar-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 280px;
    height: 100%;
    background: white;
    padding: 20px;
}

.user-info, .guest-info {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.username {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.gold {
    color: #f90;
    font-size: 14px;
}

.sidebar-menu {
    margin-top: 20px;
}

.menu-item {
    display: block;
    padding: 15px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
}

.menu-item.admin {
    color: #f00;
    font-weight: bold;
}

.menu-item.logout {
    color: #999;
}

/* 公告 */
.announcement {
    margin-top: 50px;
    padding: 10px 15px;
    background: #ffeb3b;
    color: #333;
    position: relative;
    font-size: 14px;
}

.announcement-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.close-btn {
    position: absolute;
    right: 10px;
    top: 5px;
    font-size: 20px;
    cursor: pointer;
}

/* 统计 */
.stats {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: #f8f8f8;
    font-size: 14px;
    color: #666;
}

/* 帖子列表 */
.post-list {
    padding: 10px;
}

.post-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
}

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

.avatar-tiny {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
}

.post-author {
    font-size: 14px;
    color: #666;
    flex: 1;
}

.post-time {
    font-size: 12px;
    color: #999;
}

.post-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.post-content-preview {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
    word-wrap: break-word;
}

.post-footer {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #999;
}

.post-price {
    color: #f90;
    margin-left: auto;
}

/* 分页 */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
    gap: 5px;
}

.page-btn {
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}

.page-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 登录/注册表单 */
.form-container {
    padding: 20px;
    margin-top: 50px;
}

.form-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.btn {
    width: 100%;
    padding: 14px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

.btn:hover {
    background: #0056b3;
}

.form-footer {
    margin-top: 20px;
    text-align: center;
}

.form-footer a {
    color: #007bff;
    text-decoration: none;
}

/* 个人中心 */
.profile-header {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
    margin-top: 50px;
}

.profile-avatar {
    position: absolute;
    bottom: -40px;
    left: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
}

.profile-info {
    padding: 50px 20px 20px;
    background: white;
}

.profile-stats {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

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

.stat-value {
    font-size: 20px;
    font-weight: bold;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

/* 发布帖子 */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 6px 6px 0 0;
}

.tool-btn {
    padding: 5px 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.post-content-editor {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
}

/* 帖子详情 */
.post-detail {
    margin-top: 50px;
    padding: 20px;
}

.detail-header {
    margin-bottom: 20px;
}

.detail-title {
    font-size: 22px;
    font-weight: bold;
    margin: 10px 0;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
}

.detail-content {
    font-size: 16px;
    line-height: 1.6;
    margin: 20px 0;
    word-wrap: break-word;
}

.paid-content {
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.paid-message {
    color: #f44336;
    font-size: 18px;
    margin-bottom: 15px;
}

.unlock-btn {
    background: #f90;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

/* 评论区 */
.comments-section {
    margin-top: 30px;
}

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

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

.comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.comment-author {
    font-weight: bold;
    flex: 1;
}

.comment-time {
    font-size: 12px;
    color: #999;
}

.comment-content {
    margin-left: 40px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.comment-actions {
    margin-left: 40px;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.reply-btn {
    color: #007bff;
    cursor: pointer;
}

.replies-section {
    margin-left: 40px;
    margin-top: 10px;
    padding-left: 15px;
    border-left: 2px solid #eee;
}

.reply-item {
    padding: 10px 0;
}

.more-replies {
    color: #007bff;
    cursor: pointer;
    font-size: 13px;
    margin: 5px 0;
}

/* 后台管理 */
.admin-container {
    margin-top: 50px;
    padding: 20px;
}

.admin-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.admin-tab {
    padding: 10px 20px;
    cursor: pointer;
}

.admin-tab.active {
    border-bottom: 2px solid #007bff;
    color: #007bff;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

/* 响应式 */
@media (max-width: 480px) {
    .container {
        width: 100%;
    }
}
