/* 帖子详情样式 */
.post-detail {
    background: white;
    border-radius: 3px;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.post-header {
    padding: 20px;
    position: relative;  /* 添加相对定位 */
}

.post-header:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: #eee;
}

.post-header h1 {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.5;
    color: #1a1a1a;
}

/* 作者信息和元数据 */
.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;  /* 统一减小字号 */
    color: #bbb;      /* 统一变淡颜色 */
}

.meta-left {
    display: flex;
    align-items: center;
    gap: 6px;         /* 缩小间距 */
}

.author-name {
    color: #bbb;      /* 统一变淡颜色 */
    text-decoration: none;
    font-weight: 400; /* 降低字重 */
    font-size: 12px;  /* 统一字号 */
}

.author-name:hover {
    color: #999;      /* 悬停时稍微加深 */
}

.post-time {
    color: #bbb;      /* 统一变淡颜色 */
    font-size: 12px;  /* 统一字号 */
}

.post-category {
    color: #bbb;      /* 统一变淡颜色 */
    font-size: 12px;  /* 统一字号 */
}

.view-count {
    display: flex;
    align-items: center;
    gap: 3px;         /* 缩小间距 */
    color: #bbb;      /* 统一变淡颜色 */
    font-size: 12px;  /* 统一字号 */
}

.view-count i {
    font-size: 12px;  /* 统一图标大小 */
}

/* 帖子内容 */
.post-content {
    padding: 20px 20px 35px 20px;
    font-size: 15px;
    line-height: 1.8;
    color: #1a1a1a;
}

.post-content p {
    margin: 1em 0;
}

/* 代码块容器样式 - 支持新的wrapper结构 */
.post-content .code-block-wrapper {
    position: relative;
    margin: 16px 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    
    /* 确保不会超出父容器宽度 */
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-content .code-block-wrapper pre {
    position: relative;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    box-shadow: none;
    
    /* 确保不会超出父容器宽度 */
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-content .code-block-wrapper pre::before {
    content: '';
    display: block;
    height: 36px;
    background: #f1f3f4;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.post-content .code-block-wrapper pre[data-language]::after {
    content: attr(data-language);
    position: absolute;
    top: 8px;
    left: 12px;
    color: #6c757d;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.post-content .code-block-wrapper pre code {
    display: block;
    padding: 16px;
    margin: 0;
    background: none !important;
    border: none !important;
    color: #24292e !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    white-space: pre-wrap; /* 改为pre-wrap以支持自动换行 */
    
    /* 纵向滚动，防止横向溢出 */
    overflow-y: auto;
    overflow-x: auto; /* 允许水平滚动但优先换行 */
    max-height: 300px; /* 限制最大高度，超出时纵向滚动 */
    word-wrap: break-word;
    word-break: break-word; /* 强制长单词换行 */
    
    /* 确保不会超出容器 */
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* 代码块滚动条样式 */
.post-content .code-block-wrapper pre code::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.post-content .code-block-wrapper pre code::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

.post-content .code-block-wrapper pre code::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

.post-content .code-block-wrapper pre code::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* 代码语言左边框颜色 - wrapper版本 */
.post-content .code-block-wrapper pre[data-language="javascript"] {
    border-left: 3px solid #f7df1e;
}

.post-content .code-block-wrapper pre[data-language="python"] {
    border-left: 3px solid #3776ab;
}

.post-content .code-block-wrapper pre[data-language="java"] {
    border-left: 3px solid #ed8b00;
}

.post-content .code-block-wrapper pre[data-language="php"] {
    border-left: 3px solid #777bb4;
}

.post-content .code-block-wrapper pre[data-language="css"] {
    border-left: 3px solid #1572b6;
}

.post-content .code-block-wrapper pre[data-language="html"] {
    border-left: 3px solid #e34f26;
}

.post-content .code-block-wrapper pre[data-language="sql"] {
    border-left: 3px solid #336791;
}

.post-content .code-block-wrapper pre[data-language="bash"] {
    border-left: 3px solid #4eaa25;
}

.post-content .code-block-wrapper pre[data-language="json"] {
    border-left: 3px solid #666666;
}

.post-content .code-block-wrapper pre[data-language="xml"] {
    border-left: 3px solid #0060ac;
}

/* 底部操作栏 */
.post-footer {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;  /* 让标签和操作按钮分别靠左和靠右 */
    align-items: center;
    position: relative;
}

.post-footer:before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: #eee;
}

/* 标签和操作按钮样式 */
.post-tags {
    display: flex;
    gap: 4px;  /* 减小间距 */
    flex-wrap: wrap;
    margin-right: 12px;  /* 与操作按钮保持间距 */
}

.tag {
    display: inline-flex;
    align-items: center;
    height: 20px;  /* 减小高度 */
    padding: 0 6px;  /* 减小内边距 */
    background: #f8f9fa;  /* 更浅的背景色 */
    border-radius: 2px;  /* 更小的圆角 */
    color: #999;  /* 更浅的文字颜色 */
    font-size: 11px;  /* 更小的字号 */
    text-decoration: none;
    transition: all 0.2s;
}

.tag:hover {
    background: #f0f0f0;
    color: #666;
}

/* 操作按钮容器 */
.post-actions {
    display: flex;
    gap: 4px;  /* 与tag保持一致的间距 */
    margin-left: auto;
}

/* 通用操作按钮样式 - 与tag按钮保持一致 */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 20px;  /* 与tag按钮一致的高度 */
    padding: 0 6px;  /* 与tag按钮一致的内边距 */
    background: #f8f9fa;  /* 与tag按钮一致的背景色 */
    border: none;
    border-radius: 2px;  /* 与tag按钮一致的圆角 */
    color: #8590a6;  /* 与tag按钮一致的文字颜色 */
    font-size: 11px;  /* 与tag按钮一致的字号 */
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.action-btn:hover {
    background: #f0f0f0;
    color: #666;
}

.action-btn i {
    font-size: 11px;  /* 与tag按钮一致的图标大小 */
}

/* 投票按钮特殊样式 */
.vote-btn {
    background: #f8f9fa;
    position: relative;
}

.vote-btn:hover {
    background: #fff8f7;
    color: #f4623a;
}

.vote-btn.voted {
    background: #fff0ef;
    color: #666;
}

.vote-btn .vote-count {
    font-weight: 500;
    margin-left: 2px;
    font-size: 10px;
}

/* 收藏按钮特殊样式 */
.star-btn {
    background: #f8f9fa;
}

.star-btn:hover {
    background: #fff8f0;
    color: #f39c12;
}

.star-btn.starred {
    background: #fff3cd;
    color: #f39c12;
}

.star-btn.starred i {
    color: #f39c12;
}

/* 编辑按钮样式 */
.edit-btn {
    background: #f8f9fa;
}

.edit-btn:hover {
    background: #f7f9fa;
    color: #657786;
}

/* 评论区操作按钮 */
.comment-actions {
    display: flex;
    gap: 15px;
    padding-left: 52px;
    margin-top: 8px;
}

.action-link {
    color: #999;
    font-size: 11px;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-link:hover {
    color: #666;
}

/* 评论区样式 */
.comments-section {
    margin-top: 20px;
    background: white;
    border-radius: 3px;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* 评论区标题 */
.comments-section h3 {
    padding: 15px 20px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    position: relative;
}

.comments-section h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: #eee;
}

/* 评论列表容器 */
.comment-list {
    padding: 0;
}

/* 单个评论项容器 */
.comment-item {
    padding: 15px 20px;
    position: relative;
    padding-bottom: 15px;
    padding-right: 30px;
}

.comment-item:not(:last-child):after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: #eee;
}

/* 评论头部 - V2EX风格简洁布局 */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;  /* 改为顶部对齐，避免元素过度居中 */
    margin-bottom: 8px;
    padding-bottom: 2px;
}

/* 评论用户信息区域 */
.comment-meta {
    display: flex;
    align-items: center;  /* 头像和用户信息居中对齐 */
    gap: 12px;
    font-size: 14px;
    flex: 1;
}

/* 评论内容区域右移 */
.comment-content {
    font-size: 14px;
    line-height: 1.6;
    color: #1a1a1a;
    margin: 10px 0;
    padding-left: 52px;  /* 评论内容右移，使用padding而不是margin */
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 3px;
    flex-shrink: 0;
    object-fit: cover;  /* 确保图片正确显示 */
}

.comment-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
    justify-content: center;  /* 垂直居中 */
}

.user-main-info {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

.author-name {
    color: #999;
    font-weight: 500;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.2;
}

.author-name:hover {
    color: #007bff;
    text-decoration: none;
}

/* 用户UID标签 - V站风格，更加简洁 */
.author-uid {
    color: #999;
    font-size: 11px;
    font-weight: normal;
    opacity: 0.7;
}

/* 作者徽章 - 小色块样式：背景色+白字 */
.author-badge {
    background: #8590a6;
    color: white;
    font-size: 8px;
    font-weight: 500;
    padding: 1px 4px;
    border-radius: 2px;
    margin-left: 4px;
    border: none;
    display: inline-block;
    vertical-align: middle;
    transition: all 0.2s ease;
    line-height: 10px;
    height: 12px;
    box-sizing: border-box;
    text-align: center;
}

.author-badge.maker {
    background: #1976d2;
    color: white;
    border: none;
    font-weight: 500;
}

/* 用户称号样式 - 小色块样式：背景色+白字 */
.user-title {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 8px;
    line-height: 10px;
    font-weight: 500;
    margin-left: 4px;
    vertical-align: middle;
    transition: all 0.2s ease;
    border: none;
    color: white;
    height: 12px;
    box-sizing: border-box;
    text-align: center;
}

/* 默认称号颜色 - 小色块配色 */
.user-title.default {
    background: #8590a6;
    color: white;
}

/* 悬停效果 */
.author-uid:hover {
    color: #666;
}

.author-badge:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.user-title:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.user-meta-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #999;
    margin-top: 3px;
    opacity: 0.8;
}

.comment-time {
    color: #999;
    font-size: 11px;
    opacity: 0.8;
}

.user-bio {
    color: #999;
    font-size: 11px;
    line-height: 1.3;
    max-width: 180px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0.7;
}

.comment-floor {
    padding: 1px 4px;
    border: 1px solid #eee;
    border-radius: 2px;
    color: #999;
    font-size: 11px;
    margin-left: 12px;
    flex-shrink: 0;
}

/* 评论框 */
.comment-form {
    padding: 20px;
    position: relative;
}

.comment-form:before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    background: #eee;
}

.comment-input {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    resize: vertical;
    font-size: 14px;
    margin-bottom: 10px;
}

.form-actions {
    display: flex;
    justify-content: space-between;  /* 改为两端对齐，字数统计在左侧，按钮在右侧 */
    align-items: center;
}

.char-count {
    font-size: 12px;
    color: #999;
}

.submit-comment {
    padding: 8px 16px;
    background: #778087;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
}

.submit-comment:hover {
    background: #4d5256;
}

/* 侧边栏样式 */
.sidebar {
    align-self: start;
}

.sidebar-box {
    background: white;
    border-radius: 3px;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.sidebar-box h3 {
    padding: 10px 20px;  /* 调整标题内边距，与列表项对齐 */
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #778087;
    border-bottom: 1px solid #eee;
}

/* 用户资料卡片 - 帖子页面专用样式 */
.post-user-profile {
    padding: 15px;
    background: white;
}

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

.post-profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 3px;
    flex-shrink: 0;
    object-fit: cover;
}

.post-profile-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.post-profile-main-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.post-profile-name {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0;
    line-height: 1;
    text-decoration: none;
    text-align: left;
}

.post-profile-name:hover {
    color: #007bff;
    text-decoration: underline;
}

.post-profile-bio {
    margin: 0;
    font-size: 13px;
    color: #999;
    line-height: 1.4;
}

/* 统计数据 - 帖子页面专用 */
.post-profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin: 15px 0;
    padding: 0;
    border-top: 1px solid #eee;
    padding-top: 15px;
    width: 100%;
    box-sizing: border-box;
}

.post-stat-item {
    padding: 6px 4px;
    background: #f8f9fa;
    border-radius: 3px;
    text-align: center;
    transition: background-color 0.2s;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-stat-item:hover {
    background: #f0f0f0;
}

.post-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.post-stat-label {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
    line-height: 1;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0;
}

/* 操作按钮区域 - 帖子页面专用 */
.post-profile-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.post-follow-btn,
.post-message-btn {
    flex: 1;
    height: 32px;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-follow-btn {
    background: #778087;
    color: white;
}

.post-follow-btn:hover {
    background: #4d5256;
}

.post-follow-btn.following {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.post-follow-btn.following:hover {
    background: #d6f7ff;
    color: #40a9ff;
}

.post-message-btn {
    background: #f5f5f5;
    color: #778087;
}

.post-message-btn:hover {
    background: #e2e2e2;
}

/* 无评论状态样式 */
.no-comments {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-comments-icon {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
}

.no-comments p {
    margin: 0;
    font-size: 14px;
}

/* 热议和阅读记录样式 */
.hot-topics,
.recent-reading {
    padding: 0;  /* 移除内边距，让标题和列表对齐 */
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    text-decoration: none;
    transition: background-color 0.2s;
    position: relative;
}

.topic-item:not(:last-child):after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: #eee;
}

.topic-item:hover {
    background-color: #f8f9fa;
}

.topic-avatar {
    width: 24px;
    height: 24px;
    border-radius: 3px;  /* 改为方形圆角，与评论区头像一致 */
    flex-shrink: 0;
    background: #f5f5f5;
}

.topic-title {
    flex: 1;
    font-size: 13px;
    color: #778087;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.topic-item:hover .topic-title {
    color: #007bff;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    /* 移动端根容器样式 */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* 移动端主容器 */
    body {
        background: #f5f5f5 !important;
        min-height: 100% !important;
        position: relative !important;
    }

    body .main-container {
        grid-template-columns: 1fr !important;
        padding: 0 !important; /* 移除左右间距 */
        margin: 10 0 0 0;
        width: 100% !important;
        max-width: 100% !important;
        min-height: calc(100vh - 60px) !important; /* 减去顶栏高度 */
        overflow: visible !important;
        display: block !important; /* 改用block布局 */
        box-sizing: border-box !important;
    }

    /* 强制隐藏右侧栏 */
    .sidebar {
        display: none !important;
    }

    /* 内容区域 */
    .content {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 帖子卡片 - 直接铺满屏幕 */
    .post-detail {
        margin: 0 0 10px 0 !important; /* 添加底部间距 */
        border-radius: 0 !important; /* 移除圆角 */
        box-shadow: none !important; /* 移除阴影 */
        height: auto !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        border: none !important; /* 移除边框，用间距分割 */
    }

    /* 抽奖区域 - 直接铺满屏幕 */
    .lottery-section {
        margin: 0 0 10px 0 !important; /* 添加底部间距 */
        border-radius: 0 !important; /* 移除圆角 */
        border-left: none !important;
        border-right: none !important;
        border-top: 2px solid #e1e5e9 !important; /* 添加上边框 */
        border-bottom: 2px solid #e1e5e9 !important; /* 添加下边框 */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 评论区卡片 - 直接铺满屏幕 */
    .comments-section {
        margin: 0 !important; /* 评论区作为最后一个区域，不需要底部间距 */
        border-radius: 0 !important; /* 移除圆角 */
        box-shadow: none !important; /* 移除阴影 */
        height: auto !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        border-bottom: none !important; /* 移除所有边框 */
    }

    /* 评论列表容器 */
    .comment-list {
        height: auto !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 统一内容区域内边距 - 保持卡片内部的间距 */
    .post-header,
    .post-content,
    .post-footer,
    .comment-item {
        padding: 15px 20px !important;
        height: auto !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 帖子内容 */
    .post-content {
        height: auto !important;
        overflow: visible !important;
        word-break: break-word !important;
    }

    /* 分割线对齐 */
    .post-header:after,
    .post-footer:before,
    .comment-item:not(:last-child):after {
        left: 20px !important;
        right: 20px !important;
    }

    /* 评论区样式 */
    .comment-content {
        padding-left: 52px !important;
        margin: 10px 0 !important;
        height: auto !important;
        overflow: visible !important;
        word-break: break-word !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .comment-footer {
        padding-left: 48px !important;
        margin-top: 8px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .comment-actions {
        padding-left: 52px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 评论区标题 */
    .comments-section h3 {
        padding: 15px 20px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .comments-section h3:after {
        left: 20px !important;
        right: 20px !important;
    }

    /* 移动端评论表单适配 */
    .comment-form {
        padding: 15px 20px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .comment-form:before {
        left: 20px !important;
        right: 20px !important;
    }

    /* 底部导航栏 */
    .bottom-nav {
        position: relative !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .action-btn {
        height: 20px;  /* 保持与tag一致 */
        padding: 0 4px;  /* 减小移动端内边距 */
        gap: 2px;
    }
    
    /* 移动端隐藏按钮文字，只显示图标 */
    .action-btn .btn-text {
        display: none;
    }
    
    .action-btn i {
        font-size: 12px;  /* 移动端稍大的图标 */
    }
    
    /* 移动端投票按钮隐藏数字 */
    .vote-btn .vote-count {
        display: none;
    }
    
    /* 移动端资料卡适配 */
    .post-profile-stats {
        gap: 4px;
    }
    
    .post-stat-item {
        padding: 4px 2px;
    }
    
    .post-stat-value {
        font-size: 14px;
    }
    
    .post-stat-label {
        font-size: 10px;
    }
    
    /* 移动端用户名样式 */
    .post-profile-name {
        font-size: 15px;
        text-align: left;
    }
    
    .author-name {
        font-size: 13px;
    }
    
    .author-uid {
        font-size: 11px;
    }
    
    .author-badge {
        font-size: 7px;
        padding: 1px 3px;
        margin-left: 3px;
        height: 10px;
        line-height: 8px;
    }
    
    .user-title {
        font-size: 7px;
        padding: 1px 3px;
        margin-left: 3px;
        height: 10px;
        line-height: 8px;
    }
    
    .user-bio {
        max-width: 150px;
        font-size: 11px;
    }
    
    /* 移动端优质评论印章适配 */
    .valuable-comment::after {
        width: 50px;
        height: 50px;
        top: 35px;          /* 调整移动端位置到评论内容区域 */
        left: 50px;         /* 移动端左侧位置 */
        font-size: 9px;
        border-width: 2px;
        letter-spacing: 0.5px;
        opacity: 0.7;       /* 移动端稍微更透明 */
    }
    
    /* 移动端评论菜单适配 */
    .comment-menu-trigger {
        font-size: 10px;
        padding: 2px 4px;
        color: #e0e0e0;
        opacity: 0.5;
    }
    
    .comment-menu-dropdown {
        min-width: 140px;
        right: -5px;
    }
    
    .comment-menu-item {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* 移动端评论控制区域适配 */
    .comment-controls {
        margin-bottom: 8px;
    }
    
    /* 移动端楼层号适配 */
    .comment-floor {
        color: #e0e0e0;
        opacity: 0.5;
        font-size: 10px;
    }
    
    /* 移动端评论底部适配 */
    .comment-footer {
        padding-left: 48px;
        margin-top: 8px;
    }
    
    /* 移动端左侧操作按钮组适配 */
    .comment-actions-left {
        gap: 6px; /* 移动端缩小间距 */
    }
    
    /* 移动端回复按钮适配 */
    .reply-btn {
        font-size: 10px;
        padding: 2px 4px;
        color: #e0e0e0;
        opacity: 0.5;
    }
    
    /* 移动端感谢显示适配 */
    .thanks-display {
        font-size: 10px;
        padding: 2px 4px;
        opacity: 0.5;
        gap: 3px;
    }
    
    .thanks-icon {
        font-size: 10px !important;
    }
    
    .thanks-count {
        font-size: 10px !important;
    }
    
    /* 移动端评论容器适配 */
    .comment-item {
        padding-right: 15px;
        padding-bottom: 15px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 移动端抽奖区域内部样式适配 */
    .lottery-header,
    .lottery-info,
    .lottery-actions,
    .lottery-winners {
        padding: 12px 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .lottery-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    .lottery-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .lottery-countdown {
        justify-content: center;
    }
    
    .winner-item {
        padding: 8px;
    }
    
    .winner-rank {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .winner-avatar {
        width: 20px;
        height: 20px;
    }

    /* 确保所有表单元素也不会溢出 */
    .comment-input,
    textarea,
    input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 确保代码块不会溢出 */
    .post-content pre,
    .post-content .code-block-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: auto !important;
    }

    .post-content pre code {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 确保图片不会溢出 */
    .post-content img {
        max-width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }

    /* 确保表格不会溢出 */
    .post-content table {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }
}

/* 超小屏幕额外优化 */
@media screen and (max-width: 480px) {
    /* 调整内边距 */
    .post-header,
    .post-content,
    .post-footer,
    .comment-item {
        padding: 12px 16px !important;
    }

    /* 分割线对齐 */
    .post-header:after,
    .post-footer:before,
    .comment-item:not(:last-child):after,
    .comments-section h3:after {
        left: 16px !important;
        right: 16px !important;
    }

    /* 评论区缩进 */
    .comment-content,
    .comment-footer {
        padding-left: 48px !important;
    }
}

/* 超小屏幕额外调整 */
@media screen and (max-width: 350px) {
    /* 进一步缩小内边距 */
    .post-header,
    .post-content,
    .post-footer,
    .comment-item {
        padding: 10px 14px !important;
    }

    /* 分割线对齐 */
    .post-header:after,
    .post-footer:before,
    .comment-item:not(:last-child):after,
    .comments-section h3:after {
        left: 14px !important;
        right: 14px !important;
    }

    /* 评论区缩进 */
    .comment-content,
    .comment-footer {
        padding-left: 44px !important;
    }
}

/* 帖子详情和评论区的间距 */
.post-detail + .comments-section {
    margin-top: 20px;
}

/* 评论区引用回复样式 - 确保样式存在且正确 */
.quote-content {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-left: 3px solid #778087;
    border-radius: 0 3px 3px 0;
    font-size: 12px;
    color: #666;
    overflow: hidden;
}

/* 价值评论样式 - 红色左侧边框 */
.quote-content.valuable-quote {
    background: #fff8f5;
    border-left: 3px solid #dc3545;
}

.quote-author {
    color: #778087;
    font-weight: 500;
    flex-shrink: 0;
}

.quote-text {
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* 提及样式 - 确保样式存在且正确 */
.mention {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 500;
}

/* 评论编辑表单样式 */
.comment-edit-form {
        width: 100%;
}

.comment-edit-input {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    resize: vertical;
        font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
    margin-bottom: 8px;
}

.comment-edit-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.edit-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
        gap: 10px;
    }

.edit-char-count {
        font-size: 12px;
    color: #999;
    }

.edit-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
        font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e9ecef;
    color: #333;
}

.btn-save {
    background: #778087;
    color: white;
}

.btn-save:hover {
    background: #4d5256;
}

.btn-save:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 消息提示样式 */
.message {
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

/* 优质回复整体包裹样式 */
.valuable-content {
    background: #fff8f5;
    border: 1px solid #ffd4c2;
    border-left: 4px solid #ff6b35;
    border-radius: 5px;
    padding: 12px 15px;
    margin: 8px 0;
}

/* 优质回复标记样式 */
.valuable-badge {
    color: #ff6b35;
    font-weight: 600;
    font-size: 13px;
    margin-right: 6px;
}

/* 评论控制区域 - 只包含楼层号，右对齐 */
.comment-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

/* 楼层号样式 - V2EX风格，更加简洁 */
.comment-floor {
    padding: 1px 6px;
    border: 1px solid #f5f5f5;
    border-radius: 3px;
    color: #999;
    font-size: 10px;
    opacity: 0.5;
    transition: all 0.2s ease;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.02);
    font-weight: 400;
}

.comment-floor:hover {
    opacity: 0.8;
    color: #aaa;
    background: rgba(0, 0, 0, 0.05);
    border-color: #e0e0e0;
    transform: scale(1.05);
}

/* 评论底部操作区域 - 左侧为操作按钮区，右侧为菜单 */
.comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-left: 52px; /* 与评论内容左对齐 */
}

/* 左侧操作按钮组 */
.comment-actions-left {
    display: flex;
    align-items: center;
    gap: 8px; /* 按钮之间的间距 */
}

/* 回复按钮样式 - 使用不显眼的配色 */
.reply-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 1px 4px;
    border-radius: 2px;
    opacity: 0.6;
}

.reply-btn:hover {
    color: #999;
    opacity: 0.8;
}

/* 感谢显示样式 - 与回复按钮保持一致 */
.thanks-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 4px;
    color: #ddd;
    font-size: 11px;
    cursor: default;
    opacity: 0.6;
    border-radius: 2px;
}

.thanks-icon {
    color: #ff4757 !important; /* 红色心形图标 */
    font-size: 11px;
}

.thanks-count {
    color: #ddd; /* 与回复按钮文字颜色一致 */
    font-size: 11px;
}

/* 评论操作菜单 - 现在在底部右侧，使用不显眼的配色 */
.comment-menu {
    position: relative;
    z-index: 10;
}

.comment-menu-trigger {
    background: none;
    border: none;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 1px 4px;
    border-radius: 2px;
    opacity: 0.6;
}

.comment-menu-trigger:hover {
    color: #999;
    opacity: 0.8;
    transform: rotate(45deg);
}

.comment-menu-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 100;
}

.comment-menu.active .comment-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.comment-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 0;
}

.comment-menu-item:first-child {
    border-radius: 6px 6px 0 0;
}

.comment-menu-item:last-child {
    border-radius: 0 0 6px 6px;
}

.comment-menu-item:only-child {
    border-radius: 6px;
}

.comment-menu-item:hover {
    background: #f8f9fa;
    color: #495057;
}

.comment-menu-item:not(:last-child) {
    border-bottom: 1px solid #eee;
}

.comment-menu-item.danger:hover {
    background: #fff5f5;
    color: #dc3545;
}

.comment-menu-item.primary:hover {
    background: #fff8f0;
    color: #f39c12;
}

/* 举报弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

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

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

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 2px;
}

.modal-close:hover {
    color: #333;
    background: #f5f5f5;
}

.modal-body {
    padding: 20px;
}

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

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

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 0;
}

.radio-option input[type="radio"] {
    margin: 0;
}

.radio-text {
    font-size: 14px;
    color: #555;
}

.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* 评论高亮效果 - 用于楼层定位 */
.comment-item.highlighted {
    background: rgba(255, 193, 7, 0.15);
    border-left: 4px solid #ffc107;
    transition: all 0.3s ease;
    animation: highlightPulse 0.6s ease-in-out;
}

@keyframes highlightPulse {
    0% {
        background: rgba(255, 193, 7, 0.3);
        transform: scale(1.002);
    }
    50% {
        background: rgba(255, 193, 7, 0.2);
        transform: scale(1.001);
    }
    100% {
        background: rgba(255, 193, 7, 0.15);
        transform: scale(1);
    }
}

/* 确保锚点定位时有适当的偏移量 */
.comment-item {
    scroll-margin-top: 20px;
}

/* 帖子管理菜单样式 */
.post-management-menu {
    position: relative;
    display: inline-block;
}

.management-btn {
    background: #f8f9fa;
    border: none;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
}

.management-btn:hover {
    background: #e9ecef;
    color: #6c757d;
}

.management-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 8px;
}

.post-management-menu.active .management-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.management-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #333;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0;
}

.management-item:first-child {
    border-radius: 4px 4px 0 0;
}

.management-item:last-child {
    border-radius: 0 0 4px 4px;
}

.management-item:only-child {
    border-radius: 4px;
}

.management-item:hover {
    background: #f8f9fa;
    color: #333;
}

.management-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.management-item.danger:hover {
    background: #fff5f5;
    color: #dc3545;
}

.management-item i {
    font-size: 12px;
    width: 14px;
    text-align: center;
}

/* 管理菜单中的收藏按钮样式 */
.management-item.star-btn.starred {
    color: #ffc107;
}

.management-item.star-btn.starred:hover {
    background: #fff8e1;
    color: #ff8f00;
}

/* 管理菜单中的编辑按钮样式 */
.management-item.edit-btn {
    color: #007bff;
    text-decoration: none;
}

.management-item.edit-btn:hover {
    background: #e3f2fd;
    color: #0056b3;
    text-decoration: none;
}

/* 管理菜单分隔线 */
.management-separator {
    border-top: 1px solid #e0e0e0;
    margin: 8px 0;
}

/* 管理菜单中的感谢按钮样式 */
.thanks-btn {
    color: #778087; /* 默认颜色与其他图标文字一致 */
}

.thanks-btn:hover {
    color: #495057;
}

.thanks-btn.thanked {
    color: #ff4757 !important; /* 已感谢状态为红色 */
}

.thanks-btn.thanked i {
    color: #ff4757 !important; /* 已感谢状态图标为红色 */
}

/* 代码块样式 - 简洁美观版本（向后兼容，针对没有wrapper的旧代码块） */
.post-content pre:not(.code-block-wrapper pre) {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin: 16px 0;
    padding: 0;
    overflow: hidden;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    
    /* 确保不会超出父容器宽度 */
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 代码块头部 - 包含语言标识和复制按钮 */
.post-content pre:not(.code-block-wrapper pre)::before {
    content: '';
    display: block;
    height: 36px;
    background: #f1f3f4;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

/* 语言标识 */
.post-content pre:not(.code-block-wrapper pre)[data-language]::after {
    content: attr(data-language);
    position: absolute;
    top: 8px;
    left: 12px;
    color: #6c757d;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* 复制按钮样式 */
.code-copy-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    background: #fff;
    border: 1px solid #dee2e6;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    gap: 4px;
}

.code-copy-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
    color: #495057;
}

.code-copy-btn.copied {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* 代码内容区域 - 针对没有wrapper的旧代码块 */
.post-content pre:not(.code-block-wrapper pre) code {
    display: block;
    padding: 16px;
    margin: 0;
    background: none !important;
    border: none !important;
    color: #24292e !important;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap; /* 改为pre-wrap以支持自动换行 */
    
    /* 纵向滚动，防止横向溢出 */
    overflow-y: auto;
    overflow-x: auto; /* 允许水平滚动但优先换行 */
    max-height: 300px; /* 限制最大高度，超出时纵向滚动 */
    word-wrap: break-word;
    word-break: break-word; /* 强制长单词换行 */
    
    /* 确保不会超出容器 */
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* 代码块滚动条样式 - 针对没有wrapper的旧代码块 */
.post-content pre:not(.code-block-wrapper pre) code::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.post-content pre:not(.code-block-wrapper pre) code::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

.post-content pre:not(.code-block-wrapper pre) code::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

.post-content pre:not(.code-block-wrapper pre) code::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* 内联代码样式 - 完整的块级样式 */
.post-content code {
    background: #f8f9fa !important;
    color: #e83e8c !important;
    padding: 4px 8px !important;
    margin: 2px 1px !important;
    border-radius: 4px !important;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace !important;
    font-size: 0.875em !important;
    font-weight: 500 !important;
    border: 1px solid #e9ecef !important;
    word-break: break-word !important;
    display: inline-block !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    vertical-align: baseline !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 然后覆盖代码块内的code元素样式 */
.post-content pre code {
    background: none !important;
    color: #24292e !important;
    padding: 16px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    display: block !important;
    font-size: 14px !important;
    font-weight: normal !important;
    line-height: 1.6 !important;
    box-shadow: none !important;
    white-space: pre-wrap !important;
    max-width: none !important;
}

/* 代码语言左边框颜色 - 淡化处理（针对没有wrapper的旧代码块） */
.post-content pre:not(.code-block-wrapper pre)[data-language="javascript"] {
    border-left: 3px solid #f7df1e;
}

.post-content pre:not(.code-block-wrapper pre)[data-language="python"] {
    border-left: 3px solid #3776ab;
}

.post-content pre:not(.code-block-wrapper pre)[data-language="java"] {
    border-left: 3px solid #ed8b00;
}

.post-content pre:not(.code-block-wrapper pre)[data-language="php"] {
    border-left: 3px solid #777bb4;
}

.post-content pre:not(.code-block-wrapper pre)[data-language="css"] {
    border-left: 3px solid #1572b6;
}

.post-content pre:not(.code-block-wrapper pre)[data-language="html"] {
    border-left: 3px solid #e34f26;
}

.post-content pre:not(.code-block-wrapper pre)[data-language="sql"] {
    border-left: 3px solid #336791;
}

.post-content pre:not(.code-block-wrapper pre)[data-language="bash"] {
    border-left: 3px solid #4eaa25;
}

.post-content pre:not(.code-block-wrapper pre)[data-language="json"] {
    border-left: 3px solid #666666;
}

.post-content pre:not(.code-block-wrapper pre)[data-language="xml"] {
    border-left-color: #ff5722;
}

/* 抽奖卡片 - 简洁版本 */
.lottery-section {
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    margin: 20px 0;
    overflow: hidden;
}

.lottery-header {
    padding: 16px;
    border-bottom: 1px solid #d0d7de;
    background: #f6f8fa;
}

.lottery-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.lottery-title i {
    color: #0969da;
    font-size: 16px;
}

.lottery-title h3 {
    margin: 0;
    color: #24292f;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.lottery-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: auto;
}

.lottery-status.active {
    background: #dafbe1;
    color: #137333;
}

.lottery-status.drawn {
    background: #dbeafe;
    color: #0969da;
}

.lottery-status.cancelled {
    background: #ffebe9;
    color: #cf222e;
}

.lottery-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #656d76;
}

.lottery-info {
    padding: 16px;
}

.lottery-prize {
    margin-bottom: 12px;
    padding: 12px;
    background: #f6f8fa;
    border-radius: 6px;
    border: 1px solid #d0d7de;
}

.prize-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #24292f;
    margin-bottom: 6px;
    font-size: 14px;
}

.prize-label i {
    color: #0969da;
    font-size: 14px;
}

.prize-content {
    color: #656d76;
    font-size: 14px;
    line-height: 1.5;
}

.prize-count {
    margin-top: 6px;
    font-size: 12px;
    color: #656d76;
    font-weight: 500;
}

.lottery-rules {
    margin-bottom: 12px;
    padding: 12px;
    background: #fff8c5;
    border: 1px solid #d1cc00;
    border-radius: 6px;
}

.rules-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #633c01;
    margin-bottom: 6px;
    font-size: 14px;
}

.rules-label i {
    color: #bf8700;
    font-size: 14px;
}

.rules-content {
    color: #633c01;
    font-size: 14px;
    line-height: 1.5;
}

.lottery-description {
    margin-bottom: 12px;
    padding: 12px;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
}

.desc-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #24292f;
    margin-bottom: 6px;
    font-size: 14px;
}

.desc-label i {
    color: #0969da;
    font-size: 14px;
}

.desc-content {
    color: #656d76;
    font-size: 14px;
    line-height: 1.5;
}

.lottery-actions {
    padding: 16px;
    border-top: 1px solid #d0d7de;
    background: #f6f8fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lottery-countdown {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #656d76;
}

.countdown-time {
    font-weight: 600;
    color: #cf222e;
}

.waiting-draw {
    color: #656d76;
    font-style: italic;
    font-size: 14px;
}

.lottery-cancel-btn {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    color: #cf222e;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.lottery-cancel-btn:hover {
    background: #ffebe9;
    border-color: #cf222e;
}

.lottery-cancelled {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #cf222e;
    font-weight: 500;
    font-size: 14px;
    padding: 20px;
    background: #ffebe9;
}

/* 中奖名单样式 */
.lottery-winners {
    padding: 16px;
    border-top: 1px solid #d0d7de;
}

.winners-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d0d7de;
}

.winners-header i {
    color: #fb8500;
    font-size: 16px;
}

.winners-header h4 {
    margin: 0;
    color: #24292f;
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.draw-time {
    font-size: 12px;
    color: #656d76;
}

.winners-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.winner-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.winner-item:hover {
    background: #eaeef2;
}

.winner-rank {
    background: linear-gradient(135deg, #fb8500, #e85d00);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.winner-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.winner-avatar {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
}

.winner-details {
    flex: 1;
    min-width: 0;
}

.winner-name {
    font-weight: 600;
    color: #24292f;
    margin-bottom: 2px;
    font-size: 13px;
}

.winner-floor {
    font-size: 11px;
    color: #0969da;
    margin-bottom: 2px;
}

.winner-comment {
    color: #8a8a8a;
    font-size: 12px;
    margin-top: 2px;
}

/* 付费内容和回复可见样式 */
.paid-content-notice,
.reply-required-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.paid-content-notice .notice-header,
.reply-required-notice .notice-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.paid-content-notice .notice-header i,
.reply-required-notice .notice-header i {
    font-size: 24px;
    opacity: 0.9;
}

.paid-content-notice .notice-header h3,
.reply-required-notice .notice-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.paid-content-notice .notice-body,
.reply-required-notice .notice-body {
    padding: 20px;
}

.paid-content-notice .notice-body p,
.reply-required-notice .notice-body p {
    margin: 0 0 16px 0;
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.95;
}

.purchase-section {
    text-align: center;
    margin-top: 16px;
}

.purchase-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.purchase-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.purchase-btn:active {
    transform: translateY(0);
}

.purchase-btn i {
    font-size: 14px;
}

.payment-stats {
    margin-top: 12px;
    opacity: 0.8;
    font-size: 13px;
}

.login-prompt,
.insufficient-balance {
    text-align: center;
    margin-top: 16px;
}

.login-prompt .btn,
.insufficient-balance .btn {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.login-prompt .btn:hover,
.insufficient-balance .btn:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.insufficient-balance p {
    margin-bottom: 12px;
}

.reply-prompt {
    text-align: center;
    margin-top: 16px;
    opacity: 0.9;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .paid-content-notice,
    .reply-required-notice {
        margin: 15px 0;
        border-radius: 0;
        box-shadow: none;
    }
    
    .paid-content-notice .notice-header,
    .reply-required-notice .notice-header {
        padding: 15px;
    }
    
    .paid-content-notice .notice-body,
    .reply-required-notice .notice-body {
        padding: 15px;
    }
    
    .paid-content-notice .notice-header h3,
    .reply-required-notice .notice-header h3 {
        font-size: 16px;
    }
    
    .purchase-btn {
        width: 100%;
        justify-content: center;
        font-size: 15px;
        padding: 14px 20px;
    }
}

/* 帖子内容图片样式 */
.post-content img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: block;
}

.post-content img:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* 行内图片（如表情包）的特殊处理 */
.post-content img.inline-image {
    display: inline;
    margin: 0 2px;
    vertical-align: middle;
    max-height: 1.5em;
    width: auto;
    cursor: default;
    box-shadow: none;
    border-radius: 3px;
}

.post-content img.inline-image:hover {
    transform: none;
    box-shadow: none;
}

/* 图片加载状态 */
.post-content img[data-loading="true"] {
    opacity: 0.6;
    background: #f8f9fa;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-content img[data-loading="true"]::before {
    content: "加载中...";
    color: #666;
    font-size: 14px;
}

/* 图片错误状态 */
.post-content img[data-error="true"] {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    color: #666;
    text-align: center;
    padding: 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.post-content img[data-error="true"]::before {
    content: "图片加载失败";
    color: #dc3545;
}

/* 图片标题/说明文字 */
.post-content .image-caption {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-top: 8px;
    margin-bottom: 20px;
    font-style: italic;
    line-height: 1.4;
}

/* 图片组/画廊样式 */
.post-content .image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.post-content .image-gallery img {
    margin: 0;
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
}

/* 单行多图（水平排列） */
.post-content .images-row {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    overflow-x: auto;
    padding: 5px 0;
}

.post-content .images-row img {
    flex: none;
    max-width: 300px;
    height: auto;
    margin: 0;
}

/* 响应式图片处理 */
@media screen and (max-width: 768px) {
    .post-content img {
        margin: 10px 0;
        border-radius: 6px;
    }
    
    .post-content .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .post-content .image-gallery img {
        height: 150px;
    }
    
    .post-content .images-row {
        gap: 8px;
    }
    
    .post-content .images-row img {
        max-width: 250px;
    }
}

@media screen and (max-width: 480px) {
    .post-content img {
        border-radius: 4px;
        margin: 8px 0;
    }
    
    .post-content .image-gallery {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .post-content .image-gallery img {
        height: 120px;
    }
    
    .post-content .images-row {
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .post-content .images-row img {
        max-width: 200px;
        flex: 1 1 calc(50% - 3px);
    }
}

/* 图片点击预览提示 */
.post-content img:not(.inline-image)::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.post-content img:not(.inline-image):hover::after {
    opacity: 1;
}

/* ========================= 项目关联卡片样式 ========================= */
/* 确保默认状态就能显示，不依赖JavaScript动态注入 */

.project-link-card {
    margin: 20px 0 !important;
    border: 2px solid #6b7280 !important;
    border-radius: 16px !important;
    background: #f8fafc !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    max-width: 520px !important;
    position: relative !important;
}

.project-link-card::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
    opacity: 0.7 !important;
    transition: opacity 0.3s ease !important;
}

.project-link-card:hover {
    border-color: #667eea !important;
    background: #ffffff !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15) !important;
    transform: translateY(-4px) !important;
}

.project-link-card:hover::before {
    opacity: 1 !important;
}

.project-card-content {
    position: relative;
}

.project-card-loading,
.project-card-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    color: #6b7280;
    font-size: 14px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: projectCardSpin 1s linear infinite;
}

@keyframes projectCardSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.project-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.project-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 20px 12px 20px;
    position: relative;
}

.project-icon {
    width: 48px;
    height: 48px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.favicon-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.project-meta {
    flex: 1;
    min-width: 0;
}

.project-title {
    font-weight: 700;
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #6b7280;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.stat-item i {
    font-size: 14px;
    opacity: 0.8;
}

.stat-item .fa-eye {
    color: #6366f1;
}

.stat-item .fa-star {
    color: #f59e0b;
}

.project-category-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-thumbnail {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #f1f5f9;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card-body {
    padding: 0 20px 20px 20px;
}

.project-description {
    font-size: 15px;
    line-height: 1.6;
    color: #4b5563;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 400;
}

/* 加载完成动画 */
.project-link-card.loaded {
    animation: cardLoadIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardLoadIn {
    from {
        opacity: 0.8;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Hover效果增强 */
.project-link-card:hover .project-title {
    color: #667eea;
}

.project-link-card:hover .project-icon {
    transform: scale(1.05);
    border-color: #667eea;
}

.project-link-card:hover .favicon-icon {
    transform: scale(1.1);
}

/* 焦点状态 */
.project-card-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 16px;
}

/* 特殊状态样式 */
.project-card-error .error-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .project-link-card {
        background: #1f2937 !important;
        border-color: #374151 !important;
        color: #f9fafb !important;
    }
    
    .project-link-card:hover {
        border-color: #667eea !important;
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25) !important;
    }
    
    .project-icon {
        background: #374151;
        border-color: #4b5563;
    }
    
    .project-title {
        color: #f9fafb;
    }
    
    .project-description {
        color: #d1d5db;
    }
    
    .project-card-loading,
    .project-card-error {
        color: #9ca3af;
    }
    
    .project-thumbnail {
        border-color: #4b5563;
    }
}

/* 响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    .project-link-card {
        margin: 16px 0 !important;
        max-width: 100% !important;
        border-radius: 12px !important;
        border-width: 1px !important;
    }
    
    .project-card-header {
        padding: 16px 16px 8px 16px;
        gap: 12px;
    }
    
    .project-card-body {
        padding: 0 16px 16px 16px;
    }
    
    .project-icon {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }
    
    .favicon-icon {
        width: 20px;
        height: 20px;
    }
    
    .project-title {
        font-size: 16px;
        font-weight: 600;
    }
    
    .project-description {
        font-size: 14px;
        line-height: 1.5;
        -webkit-line-clamp: 2;
        margin-bottom: 12px;
    }
    
    .project-stats {
        gap: 16px;
        font-size: 12px;
    }
    
    .project-category-tag {
        top: 12px;
        right: 12px;
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .project-thumbnail {
        width: 56px;
        height: 56px;
        border-radius: 8px;
    }
    
    .project-card-loading,
    .project-card-error {
        padding: 24px 16px;
        font-size: 13px;
    }
    
    .project-card-link:focus {
        border-radius: 12px;
    }
}

/* 超小屏幕 */
@media (max-width: 480px) {
    .project-link-card {
        margin: 12px 0 !important;
        border-radius: 10px !important;
    }
    
    .project-card-header {
        padding: 12px 12px 6px 12px;
        gap: 10px;
    }
    
    .project-card-body {
        padding: 0 12px 12px 12px;
    }
    
    .project-icon {
        width: 36px;
        height: 36px;
    }
    
    .favicon-icon {
        width: 18px;
        height: 18px;
    }
    
    .project-title {
        font-size: 15px;
    }
    
    .project-description {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .project-stats {
        gap: 12px;
        font-size: 11px;
    }
    
    .project-category-tag {
        font-size: 9px;
        padding: 2px 5px;
    }
}

/* 移动帖子弹窗样式 */
#movePostModal .modal-content {
    max-width: 500px;
    margin: 5% auto;
}

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

#movePostModal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.current-node-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #6c757d;
    font-size: 14px;
}

.current-node-display i {
    color: #007bff;
    font-size: 16px;
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #495057;
    transition: all 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-select option {
    padding: 8px;
}

#movePostModal textarea {
    resize: vertical;
    min-height: 80px;
}

#movePostModal .btn-primary {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

#movePostModal .btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

#movePostModal .btn-primary:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

#movePostModal .btn-primary i {
    margin-right: 6px;
}

/* 移动中的加载状态 */
#movePostSubmitBtn.loading {
    position: relative;
    color: transparent;
}

#movePostSubmitBtn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
