/* 论坛内容样式 - 适配玻璃拟态主题 */
.forum-content {
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.forum-content p {
    margin-bottom: 1em;
    color: var(--text-secondary);
}

.forum-content p:last-child {
    margin-bottom: 0;
}

/* 标题样式 */
.forum-content h1,
.forum-content h2,
.forum-content h3,
.forum-content h4 {
    color: var(--text-primary);
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 600;
}

.forum-content h1 { font-size: 1.25em; }
.forum-content h2 { font-size: 1.15em; }
.forum-content h3 { font-size: 1.05em; }
.forum-content h4 { font-size: 1em; }

/* 代码样式 */
.forum-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--text-primary);
}

[data-theme="light"] .forum-content code {
    background: rgba(0, 0, 0, 0.05);
}

.forum-content pre {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 1em;
    overflow-x: auto;
    margin: 1em 0;
}

[data-theme="light"] .forum-content pre {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(0, 0, 0, 0.1);
}

.forum-content pre code {
    background: none;
    padding: 0;
    color: var(--text-secondary);
}

/* 引用样式 */
.forum-content blockquote {
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    padding-left: 1em;
    margin: 1em 0;
    color: var(--text-tertiary);
    font-style: italic;
}

[data-theme="light"] .forum-content blockquote {
    border-left-color: rgba(0, 0, 0, 0.2);
}

/* 列表样式 */
.forum-content ul,
.forum-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.forum-content li {
    margin: 0.3em 0;
    color: var(--text-secondary);
}

/* 链接样式 */
.forum-content a {
    color: #60a5fa;
    text-decoration: none;
    transition: opacity 0.2s;
    word-break: break-all;
}

.forum-content a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

[data-theme="light"] .forum-content a {
    color: #2563eb;
}

/* 图片自适应样式 - 关键部分 */
.forum-content img {
    max-width: 100%;
    height: auto;
    max-height: 600px;
    border-radius: 8px;
    margin: 1em 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

[data-theme="light"] .forum-content img {
    border-color: rgba(0, 0, 0, 0.1);
}

/* 图片悬停效果 */
.forum-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* 图片容器（可选，用于居中） */
.forum-content p:has(img) {
    text-align: center;
}

/* 确保图片在移动设备上也不会溢出 */
@media (max-width: 640px) {
    .forum-content img {
        max-height: 400px;
        width: 100%;
    }
}

/* 图片加载占位符 */
.forum-content img[src=""],
.forum-content img:not([src]) {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    min-height: 200px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 分割线 */
.forum-content hr {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: 1.5em 0;
}

/* 表格样式 */
.forum-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.9em;
}

.forum-content th,
.forum-content td {
    border: 1px solid var(--glass-border);
    padding: 0.5em;
    text-align: left;
}

.forum-content th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--text-primary);
}

/* 帖子卡片特殊样式 */
.forum-post-card {
    position: relative;
    overflow: hidden;
}

.forum-post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent-color, #60a5fa), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

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

/* 回复楼层样式 */
.reply-floor {
    position: relative;
}

.reply-floor::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 40px;
    bottom: -20px;
    width: 1px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1), transparent);
}

[data-theme="light"] .reply-floor::after {
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), transparent);
}

.reply-floor:last-child::after {
    display: none;
}

/* 评论输入框样式 */
.comment-textarea {
    min-height: 100px;
    resize: vertical;
}

/* 图片点击放大遮罩层 */
.image-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.image-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.image-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    cursor: zoom-out;
}
