/* 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

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

a { color: #e6162d; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部导航 */
.main-header {
    background: linear-gradient(135deg, #e6162d 0%, #ff6b6b 100%);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.3s;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.2);
    text-decoration: none;
}

.user-info a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input {
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    width: 200px;
    outline: none;
}

.search-form button {
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
}

/* 主内容区 */
.main-content {
    padding: 20px 0;
    min-height: calc(100vh - 200px);
}

/* 首页布局 */
.home-layout {
    display: grid;
    grid-template-columns: 200px 1fr 280px;
    gap: 20px;
}

@media (max-width: 992px) {
    .home-layout {
        grid-template-columns: 1fr;
    }
    .sidebar { display: none; }
}

/* 侧边栏 */
.sidebar-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e6162d;
}

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

.user-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.user-list li:last-child {
    border-bottom: none;
}

.user-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    text-decoration: none;
}

.user-list a:hover {
    color: #e6162d;
}

/* 微博卡片 */
.post-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
}

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

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

.post-info {
    flex: 1;
}

.post-author {
    font-weight: 600;
    color: #333;
}

.post-author:hover {
    color: #e6162d;
}

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

.post-content {
    margin: 10px 0;
    font-size: 15px;
    line-height: 1.8;
    word-wrap: break-word;
}

.post-media {
    margin: 12px 0;
}

.post-media img {
    max-width: 100%;
    border-radius: 8px;
    margin: 4px;
}

.post-actions {
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid #eee;
    margin-top: 12px;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
}

.post-action:hover {
    background: #fff5f5;
    color: #e6162d;
}

.post-action.liked {
    color: #e6162d;
}

.post-action svg {
    width: 18px;
    height: 18px;
}

/* 发布框 */
.post-form {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.post-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    resize: vertical;
    font-size: 15px;
    font-family: inherit;
}

.post-form textarea:focus {
    outline: none;
    border-color: #e6162d;
}

.post-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.post-form-tools {
    display: flex;
    gap: 12px;
}

.tool-btn {
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    color: #666;
    border-radius: 6px;
    transition: all 0.3s;
}

.tool-btn:hover {
    background: #f5f5f5;
    color: #e6162d;
}

.btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #e6162d 0%, #ff6b6b 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(230, 22, 45, 0.3);
}

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

.btn-small {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-outline {
    background: white;
    color: #e6162d;
    border: 2px solid #e6162d;
}

/* 评论区 */
.comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.comment-form textarea {
    flex: 1;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    resize: vertical;
    min-height: 60px;
}

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

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

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.comment-content {
    flex: 1;
}

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

.comment-author {
    font-weight: 600;
    color: #333;
}

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

.comment-text {
    font-size: 14px;
    line-height: 1.6;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #e6162d;
}

.form-group input.error,
.form-group textarea.error {
    border-color: #e6162d;
}

.form-error {
    color: #e6162d;
    font-size: 13px;
    margin-top: 6px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    border-radius: 6px;
    background: white;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #e6162d;
    color: white;
}

.pagination .current {
    background: #e6162d;
    color: white;
}

/* 个人主页 */
.profile-header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, #e6162d 0%, #ff6b6b 100%);
    border-radius: 8px;
    margin-bottom: -60px;
}

.profile-info {
    display: flex;
    gap: 20px;
    padding: 0 20px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    background: #eee;
}

.profile-details {
    flex: 1;
    padding-top: 60px;
}

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

.profile-username {
    color: #999;
    margin-bottom: 10px;
}

.profile-bio {
    color: #666;
    margin-bottom: 15px;
}

.profile-stats {
    display: flex;
    gap: 30px;
}

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

.profile-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

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

.profile-stat a {
    color: inherit;
    text-decoration: none;
}

.profile-stat a:hover {
    color: #e6162d;
}

/* 消息页面 */
.message-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

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

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

.message-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.message-content {
    flex: 1;
}

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

.message-username {
    font-weight: 600;
}

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

.message-preview {
    color: #666;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-unread {
    background: #e6162d;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 钱包页面 */
.wallet-card {
    background: linear-gradient(135deg, #e6162d 0%, #ff6b6b 100%);
    color: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.wallet-balance {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.wallet-amount {
    font-size: 36px;
    font-weight: bold;
}

.wallet-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.wallet-btn {
    padding: 10px 24px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.wallet-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 交易记录 */
.transaction-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

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

.transaction-info h4 {
    margin-bottom: 5px;
}

.transaction-info p {
    color: #999;
    font-size: 13px;
}

.transaction-amount {
    font-size: 16px;
    font-weight: 600;
}

.transaction-amount.income {
    color: #e6162d;
}

.transaction-amount.expense {
    color: #999;
}

/* 设置页面 */
.setting-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.setting-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e6162d;
}

/* 底部 */
.main-footer {
    background: white;
    padding: 20px 0;
    text-align: center;
    color: #999;
    border-top: 1px solid #eee;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    fill: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #666;
}

/* 警告提示 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .search-form {
        order: 2;
        flex: 1;
    }
    
    .search-form input {
        width: 100%;
    }
    
    .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-stats {
        justify-content: center;
    }
    
    .wallet-actions {
        flex-direction: column;
    }
}

/* 打赏弹窗 */
.reward-modal {
    text-align: center;
}

.reward-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.reward-option {
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.reward-option:hover,
.reward-option.selected {
    border-color: #e6162d;
    background: #fff5f5;
}

.reward-amount {
    font-size: 20px;
    font-weight: bold;
    color: #e6162d;
}