/* ==================== 论坛「大舞台」样式 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #f9f5e9 0%, #f5ecd6 100%);
    color: #333;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.forum-wrap {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 12px 60px;
}

/* 顶部栏 */
.forum-top {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin: 0 -12px 14px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.forum-brand {
    font-size: 18px;
    font-weight: 800;
    color: #ffd700;
    letter-spacing: 1px;
}
.forum-nav { display: flex; gap: 10px; }
.forum-nav a { color: #d1d1e9; font-size: 13px; }
.forum-nav a:hover { color: #ffd700; }
.forum-user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.fu-av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,215,0,0.5); }
.fu-nick { color: #ffd700; font-size: 13px; font-weight: 700; }
.fu-points { color: #fff; font-size: 12px; font-weight: 600; background: rgba(212,175,55,0.18); border: 1px solid rgba(212,175,55,0.5); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.fu-points-box { font-size: 15px; font-weight: 700; color: #b8860b; padding: 8px 10px; background: #fff7e6; border: 1px solid #f0d9a8; border-radius: 8px; }
.fu-points-box span { font-size: 12px; font-weight: 400; color: #999; margin-left: 6px; }

/* 按钮（复用主站金色） */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
    background: #ddd;
    color: #333;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: linear-gradient(90deg, #d4af37, #f0d878, #d4af37); color: #4a3000; font-weight: 700; }

/* 帖子列表配图（最多 3 张） */
.post-imgs {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.post-imgs img {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: #1a1a1a;
}
@media (max-width: 480px) {
    .post-imgs img { width: 72px; height: 72px; }
}
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* 提示（固定置顶，确保即使在弹窗之上也能看到成功/失败提示） */
.alert {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    width: calc(100% - 24px);
    max-width: 760px;
    margin: 0;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transition: opacity 0.4s;
}
.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }

.empty-tip { text-align: center; padding: 40px 0; color: #999; font-size: 14px; }

/* 论坛轮播 */
.forum-banner { margin-bottom: 14px; }
.banner-slider {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    padding: 3px;
    background: linear-gradient(90deg, #b8860b, #ffd700, #ffec8b, #b8860b, #ffd700);
    background-size: 200% auto;
    animation: borderFlow 2.5s linear infinite;
    box-shadow: 0 4px 16px rgba(184,134,11,0.25);
}
.banner-track { display: flex; transition: transform 0.5s ease-in-out; }
.banner-item { min-width: 100%; max-width: 100%; border-radius: 12px; overflow: hidden; background: #1a0a00; }
.banner-item img { width: 100%; height: auto; min-height: 150px; object-fit: cover; }

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

/* 分类切换 */
.forum-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.forum-cat {
    border: 1px solid rgba(212,175,55,0.6);
    background: rgba(255,255,255,0.7);
    color: #8b6914;
    padding: 6px 16px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 700;
}
.forum-cat.active {
    background: linear-gradient(90deg, #d4af37, #f0d878, #d4af37);
    color: #4a3000;
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(212,175,55,0.4);
}

/* 帖子列表 */
.post-list { display: flex; flex-direction: column; gap: 12px; }
.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid rgba(212,175,55,0.25);
}
.post-top {
    position: absolute; top: 10px; right: 12px;
    background: #e74c3c; color: #fff; font-size: 11px;
    padding: 2px 8px; border-radius: 10px; font-weight: 700;
}
.post-title { font-size: 16px; font-weight: 800; color: #2d2d2d; margin-bottom: 6px; }
.post-excerpt { font-size: 13px; color: #777; line-height: 1.5; margin-bottom: 10px; }
.post-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #999; flex-wrap: wrap; margin-top: 14px; }
.post-av { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.post-cat { background: #fff7e0; color: #b8860b; padding: 1px 8px; border-radius: 8px; }
.post-date { margin-left: auto; }
.post-stat { color: #b8860b; font-weight: 700; }

/* 分页 */
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pager-item { padding: 6px 12px; border-radius: 8px; background: #fff; border: 1px solid rgba(212,175,55,0.4); font-size: 13px; color: #8b6914; }
.pager-item.active { background: #d4af37; color: #4a3000; font-weight: 700; }

/* 帖子详情 */
.post-detail { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 16px; }
.back-link { color: #b8860b; font-size: 13px; font-weight: 700; }
.pd-title { font-size: 20px; font-weight: 800; margin: 10px 0; color: #2d2d2d; }
.pd-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #999; margin-bottom: 12px; flex-wrap: wrap; }
.pd-content { font-size: 15px; line-height: 1.8; color: #444; white-space: pre-wrap; word-break: break-word; }
.pd-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.pd-images img { border-radius: 8px; object-fit: cover; max-height: 200px; }
.pd-like { margin-top: 16px; }
.like-btn {
    display: inline-block; padding: 8px 18px; border-radius: 20px;
    background: #fff; border: 1px solid rgba(212,175,55,0.6);
    color: #b8860b; font-weight: 700; font-size: 14px;
}
.like-btn.liked { background: #ffe3e3; border-color: #e74c3c; color: #e74c3c; }

/* 评论 */
.comment-area { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.ca-title { font-size: 16px; font-weight: 800; margin-bottom: 12px; color: #2d2d2d; }
.comment-form { margin-bottom: 16px; }
.comment-login { text-align: center; padding: 14px; color: #999; }
.comment-login a { color: #b8860b; font-weight: 700; }

.comment-list { display: flex; flex-direction: column; gap: 14px; }
.cmt { border-bottom: 1px solid #f0f0f0; padding-bottom: 12px; }
.cmt:last-child { border-bottom: none; }
.cmt-reply { margin-top: 10px; padding-left: 14px; border-left: 2px solid #f0e6d2; }
.cmt-head { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 4px; }
.cmt-av { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.cmt-nick { font-weight: 700; color: #555; }
.cmt-reply-to { color: #b8860b; font-size: 11px; }
.cmt-time { color: #bbb; margin-left: auto; }
.cmt-body { font-size: 14px; line-height: 1.6; color: #444; white-space: pre-wrap; word-break: break-word; }
.cmt-reply-btn { margin-top: 6px; background: none; border: none; color: #b8860b; font-size: 12px; cursor: pointer; font-weight: 700; }
.reply-form { margin-top: 8px; }
.cmt-cancel { background: #eee; }
.cmt-children { margin-top: 4px; }

/* 发帖表单 */
.post-form-box { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.pf-title { font-size: 18px; font-weight: 800; margin-bottom: 14px; color: #2d2d2d; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: #555; font-size: 13px; }
.form-control { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; font-family: inherit; }
.form-control:focus { outline: none; border-color: #d4af37; }
textarea.form-control { resize: vertical; }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 1000; display: none; }
.modal.open { display: block; }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.modal-box {
    position: relative;
    max-width: 360px;
    margin: 100px auto;
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 16px; color: #1a1a2e; text-align: center; }
.modal-foot { text-align: center; font-size: 13px; color: #999; margin-top: 14px; }
.modal-foot a { color: #b8860b; font-weight: 700; }
.modal-close { position: absolute; top: 10px; right: 16px; font-size: 22px; color: #999; cursor: pointer; }
.profile-av { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 0 auto 8px; }

/* 右下角悬浮回主站 */
.float-home {
    position: fixed; right: 18px; bottom: 18px; z-index: 900;
    background: linear-gradient(90deg, #d4af37, #f0d878, #d4af37);
    color: #4a3000; font-weight: 700; padding: 10px 18px; border-radius: 24px;
    box-shadow: 0 4px 14px rgba(184,134,11,0.4); text-decoration: none; font-size: 14px;
}
.float-home:hover { opacity: 0.9; }

/* 右下角悬浮抽奖入口（位于「回主站」上方） */
.float-lottery {
    position: fixed; right: 18px; bottom: 66px; z-index: 900;
    background: linear-gradient(90deg, #ff6a3d, #ff3d77);
    color: #fff; font-weight: 700; padding: 10px 18px; border-radius: 24px;
    box-shadow: 0 4px 14px rgba(255,61,119,0.4); text-decoration: none; font-size: 14px;
}
.float-lottery:hover { opacity: 0.9; }

/* 头像/昵称下拉菜单（个人信息 / 退出） */
.fu-userbox { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.fu-av, .fu-nick { cursor: pointer; }
.fu-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 8px;
    background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
    overflow: hidden; min-width: 132px; display: none; z-index: 1000;
}
.fu-dropdown.open { display: block; }
.fu-dropdown a {
    display: block; padding: 12px 16px; color: #333; text-decoration: none; font-size: 14px;
    border-bottom: 1px solid #f0f0f0; white-space: nowrap;
}
.fu-dropdown a:last-child { border-bottom: none; }
.fu-dropdown a:hover { background: #f7f7f7; }

/* 逐张添加图片预览 */
.img-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.img-thumb { position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(212,175,55,0.3); background: #1a1a1a; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; line-height: 18px; text-align: center; background: rgba(0,0,0,0.6); color: #fff; border-radius: 50%; cursor: pointer; font-size: 12px; }

@media (max-width: 480px) {
    .forum-brand { font-size: 16px; }
    .forum-nav { display: none; }
    .post-title { font-size: 15px; }
    .pd-title { font-size: 18px; }
}
