/* Topic 详情页样式 */

/* 回复内容样式 */
.reply-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    margin: 10px 0 !important;
}

.reply-content table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 15px 0 !important;
}

.reply-content table th,
.reply-content table td {
    border: 1px solid #dee2e6 !important;
    padding: 8px 12px !important;
    text-align: left !important;
}

.reply-content table th {
    background-color: #f8f9fa !important;
    font-weight: 600 !important;
}

/* 确保所有容器都不限制高度 */
.container, .card, .card-body, .row, .col-md-6, .col-12 {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* 确保表单容器不限制高度 */
form, .mb-3, .mt-4 {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* 确保回复表单容器不限制高度 */
#replyForm {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* 回复文本框样式 - 关键样式 */
#replyContent {
    width: 100% !important;
    min-height: 300px !important;
    resize: none !important;
    overflow-y: hidden !important; /* 隐藏垂直滚动条 */
    height: auto !important;
    /* 统一字体大小、行高和字体族，与预览区域保持一致 */
    font-size: 1rem !important; /* 16px，与预览区域一致 */
    line-height: 1.6 !important; /* 与预览区域一致 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    padding: 0.75rem !important; /* 与预览区域padding保持一致 */
    max-height: none !important;
    box-sizing: border-box !important;
    display: block !important;
    border-right: none !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

#reply-preview {
    border-left: none !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    /* 统一字体大小、行高和字体族，与编辑框保持一致 */
    font-size: 1rem !important; /* 16px */
    line-height: 1.6 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    padding: 0.75rem !important; /* 与编辑框padding保持一致 */
}

/* 确保按钮区域不限制高度 */
.d-flex, .justify-content-between, .align-items-center {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* 小屏幕适配 */
@media (max-width: 768px) {
    #replyContent {
        margin-bottom: 10px !important;
    }

    .row.g-0 .col-md-6 {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* 确保模态框内容不限制高度 */
.modal-content, .modal-body {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* 移除全局字体大小调整，使用编辑器特定的样式 */

/* 推荐话题网格样式 - 一行5个 */
@media (min-width: 992px) {
    .related-topics-grid {
        display: flex;
        flex-wrap: wrap;
    }
    
    .related-topic-item {
        flex: 0 0 20%;
        max-width: 20%;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .related-topics-grid .related-topic-item:nth-child(n+6) {
        margin-top: 1rem;
    }
}

@media (min-width: 1200px) {
    .related-topic-item {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* 推荐话题卡片链接样式 - 整个卡片可点击 */
.related-topic-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.related-topic-card-link:hover {
    text-decoration: none;
}

.related-topic-card-link:hover .related-topic-card {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    border-color: #0d6efd !important;
}

.related-topic-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.related-topic-card-link:active .related-topic-card {
    transform: translateY(0);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

