/* ============================================================
   AI Drama — Community Forum styles
   常规社区论坛界面（phpBB 风格表格式）
   ============================================================ */

.ai-forum-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}

.ai-forum-header {
    background: linear-gradient(135deg, #4a3f8f, #7f5af0 45%, #ff4b6e);
    border-radius: 12px;
    padding: 32px 28px;
    color: #fff;
    margin-bottom: 18px;
}
.ai-forum-header h1 { margin: 0 0 6px; font-size: 28px; }
.ai-forum-header p { margin: 0; opacity: .92; font-size: 14px; }

.ai-breadcrumb { font-size: 13px; color: #888; margin: 8px 0 16px; }
.ai-breadcrumb a { color: #7f5af0; text-decoration: none; }
.ai-breadcrumb a:hover { text-decoration: underline; }

/* 布局：主列 + 侧栏 */
.ai-forum-layout { display: flex; gap: 20px; align-items: flex-start; }
.ai-forum-main { flex: 1 1 auto; min-width: 0; }
.ai-forum-side { flex: 0 0 280px; display: flex; flex-direction: column; gap: 16px; }

.ai-side-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.ai-side-card h3 {
    margin: 0 0 12px; font-size: 14px; font-weight: 700; color: #4a3f8f;
    padding-bottom: 8px; border-bottom: 2px solid #f0f0f0;
}
.ai-side-stat { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; color: #666; }
.ai-side-stat b { color: #333; }
.ai-side-list { list-style: none; margin: 0; padding: 0; }
.ai-side-list li { padding: 5px 0; font-size: 13px; }
.ai-side-list a { color: #4a3f8f; text-decoration: none; }
.ai-side-list a:hover { text-decoration: underline; }
.ai-mem { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }

/* ============ 论坛表（板块/主题通用） ============ */
.ai-forum-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.ai-forum-table thead th {
    background: #f6f7f9;
    color: #333;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}
.ai-forum-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f1f3;
    vertical-align: top;
    font-size: 14px;
}
.ai-forum-table tbody tr:last-child td { border-bottom: none; }
.ai-forum-table tbody tr:hover { background: #fafbff; }
.ai-forum-cathead td {
    background: #4a3f8f;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 8px 14px;
}

.ai-forum-title { color: #222; text-decoration: none; font-weight: 600; font-size: 15px; }
.ai-forum-title:hover { color: #7f5af0; }
.ai-forum-desc { color: #777; font-size: 12.5px; margin-top: 2px; line-height: 1.5; }
.ai-forum-stats { text-align: center; color: #555; font-size: 13px; white-space: nowrap; }
.ai-forum-last { color: #888; font-size: 12px; min-width: 130px; }
.ai-forum-icon { font-size: 26px; text-align: center; width: 46px; }

/* 主题列表行 */
.ai-topic-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-topic-title a { color: #222; text-decoration: none; font-weight: 600; font-size: 14.5px; }
.ai-topic-title a:hover { color: #7f5af0; }
.ai-topic-meta { color: #999; font-size: 12px; margin-top: 3px; }
.ai-topic-meta a { color: #7f5af0; text-decoration: none; }
.ai-topic-count { text-align: center; color: #555; font-size: 13px; }
.ai-topic-likes { text-align: center; color: #f59e0b; font-size: 13px; }

.ai-badge {
    display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
}
.ai-badge-pinned { background: #ff4b6e; color: #fff; }
.ai-badge-locked { background: #e5e7eb; color: #666; }
.ai-badge-new { background: #22c55e; color: #fff; }
.ai-badge-hot { background: #f59e0b; color: #fff; }

/* 分页 */
.ai-pagination { display: flex; gap: 6px; align-items: center; margin-top: 16px; }
.ai-pagination a, .ai-pagination span {
    padding: 6px 12px; border-radius: 6px; font-size: 13px; text-decoration: none;
    background: #fff; border: 1px solid #e5e7eb; color: #4a3f8f;
}
.ai-pagination .current { background: #7f5af0; color: #fff; border-color: #7f5af0; }

/* 工具条（排序/搜索/发帖按钮） */
.ai-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ai-toolbar .spacer { flex: 1; }
.ai-btn {
    display: inline-block; padding: 9px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
    text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.ai-btn-primary { background: #ff4b6e; color: #fff; }
.ai-btn-primary:hover { background: #e6395c; }
.ai-btn-dark { background: #333; color: #fff; }
.ai-btn-ghost { background: #fff; border-color: #e5e7eb; color: #4a3f8f; }
.ai-btn-ghost:hover { background: #f6f7f9; }
.ai-search { display: flex; gap: 8px; flex: 1; min-width: 200px; }
.ai-search input, .ai-reply-input, .ai-topic-input {
    flex: 1; padding: 9px 14px; border: 1px solid #ddd; border-radius: 22px; font-size: 14px;
}
.ai-btn-pill { border-radius: 22px; }

/* 排序切换 */
.ai-sort a, .ai-sort span {
    padding: 6px 14px; border-radius: 20px; font-size: 13px; text-decoration: none;
    background: #fff; border: 1px solid #e5e7eb; color: #4a3f8f; display: inline-block;
}
.ai-sort .active { background: #ff4b6e; color: #fff; border-color: #ff4b6e; }

/* ============ 主题页 / 帖子楼 ============ */
.ai-post {
    display: flex; gap: 0;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 14px;
    overflow: hidden;
}
.ai-post-author {
    flex: 0 0 170px; background: #fafbff; border-right: 1px solid #eee;
    padding: 16px 14px; text-align: center;
}
.ai-post-author .avatar { display: block; margin: 0 auto 8px; }
.ai-post-author .name { font-weight: 700; color: #222; font-size: 14px; }
.ai-post-author .role { font-size: 11px; color: #7f5af0; display: block; margin-top: 2px; }
.ai-post-author .meta { font-size: 11px; color: #999; margin-top: 8px; line-height: 1.6; }
.ai-post-body { flex: 1; min-width: 0; padding: 16px 20px; }
.ai-post-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #999; margin-bottom: 8px; }
.ai-post-content { font-size: 14px; line-height: 1.7; color: #333; white-space: pre-wrap; word-break: break-word; }
.ai-post-actions { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f3f4f6; font-size: 13px; }
.ai-action { background: none; border: 0; color: #7f5af0; cursor: pointer; font-size: 13px; padding: 2px 4px; }
.ai-action:hover { text-decoration: underline; }
.ai-action.like { color: #ff4b6e; }

.ai-reply-box { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 18px; }
.ai-reply-box textarea, .ai-reply-box .ai-input {
    width: 100%; box-sizing: border-box; padding: 11px 14px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 14px; margin-bottom: 10px; font-family: inherit;
}

.ai-msg {
    padding: 9px 13px; border-radius: 8px; font-size: 13px; margin-bottom: 10px;
}
.ai-msg-err { background: #fdecea; color: #c0392b; }
.ai-msg-ok { background: #e7f6ec; color: #1e7e34; }

/* 响应式 */
@media (max-width: 900px) {
    .ai-forum-layout { flex-direction: column; }
    .ai-forum-side { flex: 1 1 auto; width: 100%; }
    .ai-post { flex-direction: column; }
    .ai-post-author { flex: 1 1 auto; border-right: none; border-bottom: 1px solid #eee; }
    .ai-forum-table { display: block; overflow-x: auto; }
    .hide-mobile { display: none; }
}
