/* 论坛页面专属样式 */

/* 内容包装器样式 */
.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* 发新帖浮动按钮 */
.forum-create-post {
    position: fixed;
    right: 20px;
    bottom: 90px;
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.forum-create-post-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white;
    position: relative;
    overflow: hidden;
}

.forum-create-post-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    transition: left 0.7s;
    left: -100%;
}

.forum-create-post-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.forum-create-post-btn:hover::before {
    left: 100%;
}

.forum-create-post-btn:active {
    transform: scale(0.95);
}

.forum-create-post-btn .icon {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    position: relative;
    z-index: 1;
}

/* 专属帖子组件美化 */
.forum-sidebar {
    flex-shrink: 0;
    width: 280px;
}

/* 卡片容器美化 */
.forum-sidebar .card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border: 1px solid #e8ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.forum-sidebar .card::before {  
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.02) 0%, transparent 70%);
    pointer-events: none;
}

.forum-sidebar .card-header {
    position: relative;
    z-index: 1;
    padding: 20px 20px 15px;
    border-bottom: 1px solid #e8ecef;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.forum-sidebar .card-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.forum-sidebar .card-header h2::before {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.forum-sidebar .card-body {
    padding: 0px 0px 0px;
}

/* 帖子卡片美化 */
.forum-sidebar .forum-post {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e8ecef;
    margin-bottom: 15px;
    padding: 16px;
}

.forum-sidebar .forum-post:last-child {
    margin-bottom: 0;
}

.forum-sidebar .forum-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    border: 2px solid transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.forum-sidebar .forum-post:hover::before {
    opacity: 1;
}

.forum-sidebar .forum-post:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* 标题美化 */
.forum-sidebar .forum-post h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.forum-sidebar .forum-post h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
    font-weight: 600;
}

.forum-sidebar .forum-post h3 a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

.forum-sidebar .forum-post:hover h3 a::after {
    width: 100%;
}

.forum-sidebar .forum-post h3 a:hover {
    color: var(--primary-color);
}

/* 元数据美化 */
.forum-sidebar .forum-post .post-meta {
    color: #95a5a6;
    font-size: 0.75rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.forum-sidebar .forum-post .post-meta::before {
    color: #bdc3c7;
    font-size: 0.8rem;
}

/* 预览文本美化 */
.forum-sidebar .forum-post .post-preview {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #7f8c8d;
    position: relative;
    padding-left: 18px;
    margin: 0;
}

.forum-sidebar .forum-post .post-preview::before {
    position: absolute;
    left: 0;
    top: -2px;
    font-size: 1.3rem;
    color: #d5dbdb;
    font-family: Georgia, serif;
    line-height: 1;
    font-weight: 300;
}

/* 服务器规则卡片专属效果 */
.forum-sidebar .forum-post[data-category="primary"] {
    background: linear-gradient(135deg, #e8f4fd 0%, #ffffff 100%);
    border-color: #d4e9f7;
}

.forum-sidebar .forum-post[data-category="primary"]:hover {
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.15);
}

.forum-sidebar .forum-post[data-category="primary"]::before {
    border-color: #3498db;
}

.forum-sidebar .forum-post[data-category="primary"] h3 a {
    color: #2980b9;
}

.forum-sidebar .forum-post[data-category="primary"] h3 a:hover {
    color: #1a5276;
}

/* 最新公告卡片专属效果 */
.forum-sidebar .forum-post[data-category="accent"] {
    background: linear-gradient(135deg, #fef5e7 0%, #ffffff 100%);
    border-color: #fdebd0;
}

.forum-sidebar .forum-post[data-category="accent"]:hover {
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.15);
}

.forum-sidebar .forum-post[data-category="accent"]::before {
    border-color: #f39c12;
}

.forum-sidebar .forum-post[data-category="accent"] h3 a {
    color: #d68910;
}

.forum-sidebar .forum-post[data-category="accent"] h3 a:hover {
    color: #9a7d0a;
}

/* Tabs美化 */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.tabs::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    opacity: 0.8;
}

.tab {
    padding: 12px 28px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: #6c757d;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 10px;
    font-weight: 500;
    letter-spacing: 0.5px;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.tab:hover::before {
    width: 200%;
    height: 200%;
}

.tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
    transform: translateY(-2px);
}

.tab.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    transform: translateY(-2px);
}

.tab.active::after {
    display: none;
}

.tab.active::before {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    width: 150%;
    height: 150%;
}

/* Fade-in动画美化 */
.fade-in {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.fade-in-delay-1 {
    transition-delay: 0.15s;
}

.fade-in-delay-2 {
    transition-delay: 0.3s;
}

.fade-in-delay-3 {
    transition-delay: 0.45s;
}

.fade-in-delay-4 {
    transition-delay: 0.6s;
}

.fade-in-delay-5 {
    transition-delay: 0.75s;
}

.fade-in-delay-6 {
    transition-delay: 0.9s;
}

/* 内容编辑器容器 */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
    position: relative;
}

.content-editor {
    display: flex;
    flex-direction: column;
}

.content-editor textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #2c3e50;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    resize: vertical;
    min-height: 300px;
    line-height: 1.6;
}

.content-editor textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: #fafbfc;
}

.content-editor textarea:hover {
    border-color: #d4e9f7;
}

.content-preview {
    display: flex;
    flex-direction: column;
    border: 2px solid #e8ecef;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.preview-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.markdown-content {
    padding: 16px;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
    color: #2c3e50;
    font-size: 0.95rem;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #2c3e50;
}

.markdown-content h1 {
    font-size: 1.8em;
    border-bottom: 2px solid #e8ecef;
    padding-bottom: 0.3em;
}

.markdown-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #e8ecef;
    padding-bottom: 0.3em;
}

.markdown-content h3 {
    font-size: 1.3em;
}

.markdown-content p {
    margin-bottom: 1em;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content li {
    margin-bottom: 0.5em;
}

.markdown-content code {
    background: #f4f6f8;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.9em;
    color: #e74c3c;
}

.markdown-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1em;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: #ecf0f1;
}

.markdown-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 16px;
    margin: 1em 0;
    color: #7f8c8d;
    font-style: italic;
}

.markdown-content a {
    color: #667eea;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid #e8ecef;
    padding: 8px 12px;
    text-align: left;
}

.markdown-content th {
    background: #f4f6f8;
    font-weight: 600;
}

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

.markdown-content hr {
    border: none;
    border-top: 2px solid #e8ecef;
    margin: 2em 0;
}

.markdown-content strong {
    font-weight: 700;
    color: #2c3e50;
}

.markdown-content em {
    font-style: italic;
    color: #7f8c8d;
}

/* 编辑器工具栏样式 */
.editor-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px 8px 0 0;
    border: 2px solid #e8ecef;
    border-bottom: none;
}

.editor-toolbar .btn {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.editor-toolbar .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 图片上传区域样式 */
.upload-area {
    border: 2px dashed #e8ecef;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f2ff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e8f0ff;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.6;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.9rem;
    color: #95a5a6;
}

.upload-input {
    display: none;
}

/* 上传进度条样式 */
.upload-progress {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e8ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0;
}

.upload-status {
    text-align: center;
    font-size: 0.95rem;
    color: #667eea;
    font-weight: 500;
}

/* 图片预览样式 */
.image-preview {
    margin: 20px 0;
}

.preview-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.image-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #6c757d;
}

.image-info p {
    margin: 5px 0;
}

.upload-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .editor-toolbar {
        flex-wrap: wrap;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
}

/* ── 主帖子列表卡片美化 ── */
.forum-main .forum-post {
    background: #ffffff;
    border: 1px solid #e8ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.forum-main .forum-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    border-color: #d0d7de;
}

/* 帖子头部：标题左、点赞收藏右 */
.forum-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.forum-post-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.forum-post-header h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
}

.forum-post-header h3 a:hover {
    color: var(--primary-color, #667eea);
}

.forum-post-header .post-category {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 12px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
}

/* 右侧点赞/收藏按钮组 */
.forum-post-actions-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-like,
.btn-bookmark {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.25s ease;
    user-select: none;
}

.btn-like:hover {
    background: #fff0f0;
    border-color: #ffb3b3;
    color: #e74c3c;
}

.btn-like.liked {
    background: #fff0f0;
    border-color: #ffb3b3;
    color: #e74c3c;
}

.btn-bookmark:hover {
    background: #fff8e1;
    border-color: #ffe082;
    color: #f39c12;
}

.btn-bookmark.bookmarked {
    background: #fff8e1;
    border-color: #ffe082;
    color: #f39c12;
}

/* 元数据 */
.forum-main .forum-post .post-meta {
    font-size: 0.78rem;
    color: #95a5a6;
    margin: 8px 0 10px;
}

/* 内容摘要 */
.forum-main .forum-post .post-content-container {
    margin-bottom: 12px;
}

.forum-main .forum-post .post-content {
    font-size: 0.88rem;
    color: #7f8c8d;
    line-height: 1.6;
    margin: 0;
}

/* 底部操作区 */
.forum-main .forum-post .post-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

@media (max-width: 600px) {
    .forum-post-header {
        flex-direction: column;
    }
    .forum-post-actions-right {
        align-self: flex-end;
    }
}

/* 投票选项行输入框（发帖时） */
.poll-option-row input:focus {
    outline: none;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
