/* ============================================================
   社区样式（帖子列表 / 详情 / 楼中楼 / 发帖）
   配色沿用主站 CSS 变量，缺省值兜底
   ============================================================ */
.comm-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 680px; margin: 0 auto 12px; gap: 10px;
}
.comm-tabs { display: flex; gap: 8px; }
.comm-tab {
    border: 1px solid var(--border, #2a2f3a); background: transparent; color: inherit;
    padding: 6px 16px; border-radius: 16px; font-size: 14px; cursor: pointer;
}
.comm-tab.active { background: #c9974b; border-color: #c9974b; color: #17120a; font-weight: 600; }
.comm-new-btn {
    flex: 0 0 auto;      /* 不被 flex 拉伸成巨长按钮 */
    width: auto;
    padding: 8px 16px;
    margin-left: auto;
}

#comm-feed { max-width: 680px; margin: 0 auto; }
.comm-tip { color: #9aa0b0; text-align: center; padding: 20px; font-size: 14px; }
.comm-tip-err { color: #d97268; }
.comm-more-row { text-align: center; color: #7d8494; font-size: 13px; padding: 14px 0 26px; cursor: pointer; }

/* ---- 帖子卡片 ---- */
.comm-card {
    background: var(--surface-raised, #171a21);
    border: 1px solid var(--border, #2a2f3a);
    border-radius: 12px; padding: 14px; margin-bottom: 12px; cursor: pointer;
    transition: border-color .15s;
}
.comm-card:active { border-color: #c9974b; }
.comm-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.comm-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.comm-avatar.vip { box-shadow: 0 0 0 2px #c9974b; }
.comm-avatar-text {
    display: inline-flex; align-items: center; justify-content: center;
    background: #2b3140; color: #e6e8ee; font-weight: 700; font-size: 15px;
}
.comm-card-meta { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.comm-author-name { font-size: 14px; font-weight: 600; }
.comm-time { font-size: 12px; color: #8b92a2; }
.comm-card-title { font-size: 16px; font-weight: 700; line-height: 1.5; margin-bottom: 6px; }
.comm-card-excerpt { font-size: 14px; color: #b7bdc9; line-height: 1.6; margin-bottom: 8px; }
.comm-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.comm-thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; background: #22262f; }
.comm-card-foot { display: flex; align-items: center; gap: 16px; font-size: 13px; color: #8b92a2; }
.comm-stat { display: inline-flex; align-items: center; gap: 5px; }
.comm-like { cursor: pointer; }
.comm-like.on { color: #e0685f; }
.comm-more {
    margin-left: auto; width: 20px; height: 20px; border-radius: 50%;
    border: 1px solid #3a4150; display: inline-flex; align-items: center;
    justify-content: center; font-size: 12px; color: #8b92a2;
}
.comm-badge {
    font-size: 12px; padding: 3px 8px; border-radius: 10px;
    background: rgba(201,151,75,.14); color: #d8b071; white-space: nowrap;
}

/* ---- 详情 ---- */
.comm-detail-wrap { max-width: 680px; margin: 0 auto; }
#comm-detail {
    background: var(--surface-raised, #171a21); border: 1px solid var(--border, #2a2f3a);
    border-radius: 12px; padding: 16px; margin-bottom: 14px;
}
.comm-detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.comm-detail-title { font-size: 19px; font-weight: 700; line-height: 1.5; margin: 0 0 10px; }
.comm-detail-content { font-size: 15px; line-height: 1.8; color: #ccd1db; word-break: break-word; }
.comm-detail-images { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.comm-detail-images img { width: 100%; border-radius: 10px; cursor: zoom-in; }
.comm-detail-foot {
    display: flex; align-items: center; gap: 16px; margin-top: 14px;
    font-size: 13px; color: #8b92a2; flex-wrap: wrap;
}
.comm-like-lg { font-size: 15px; }
.comm-report, .comm-del { cursor: pointer; color: #8b92a2; }
.comm-report:hover { color: #d97268; }
.comm-del:hover { color: #d97268; }
.comm-replay-box {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-top: 12px; padding: 10px 12px; border-radius: 10px;
    background: rgba(201,151,75,.08); border: 1px dashed rgba(201,151,75,.4);
}
.comm-replay-info { font-size: 14px; color: #d8b071; }
.comm-replay-btn { width: auto; padding: 8px 16px; }

/* ---- 帖子详情页：顶部标题 + 右上角关闭 ---- */
/* 详情页顶部：不占任何高度，只把关闭按钮浮在页面顶部留白里，
   这样帖子内容会直接顶到页面上方（不再空一整条） */
.comm-detail-page-head {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
    height: 0;
    padding: 0;
    display: block;
}
.comm-detail-page-head .comm-close-btn {
    position: absolute;
    top: 4px;
    right: 2px;
    width: 30px;
    height: 30px;
    font-size: 18px;
}
/* 作者行右侧给关闭按钮让位，避免文字/头像被压到 */
#page-community-post .comm-detail-head { padding-right: 40px; }
.comm-close-btn {
    position: absolute; top: 0; right: 0;
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--border, #2a2f3a); background: var(--surface-raised, #171a21);
    color: inherit; font-size: 20px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.comm-close-btn:active { background: #2b3140; }

/* ---- 底部固定回复栏（替代底部导航，仿短视频评论区）---- */
#page-community-post.active { padding-bottom: 84px; }
.comm-reply-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: var(--surface, #12141a);
    border-top: 1px solid var(--border, #2a2f3a);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
}
.comm-reply-target {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: #d8b071; padding: 2px 4px 6px;
}
.comm-reply-arrow { font-size: 14px; }
.comm-reply-target-name { font-weight: 600; }
.comm-reply-target-cancel {
    margin-left: auto; cursor: pointer; color: #8b92a2; font-size: 15px; padding: 0 4px;
}
.comm-reply-row { display: flex; align-items: center; gap: 8px; }
.comm-reply-row input {
    flex: 1; min-width: 0; padding: 10px 12px; border-radius: 20px;
    border: 1px solid var(--border, #2a2f3a); background: var(--surface-raised, #171a21);
    color: inherit; font-size: 14px; outline: none;
}
.comm-reply-row input:focus { border-color: #c9974b; }
.comm-reply-send-btn {
    flex: 0 0 auto; padding: 9px 18px; border-radius: 20px; border: none;
    background: #c9974b; color: #17120a; font-size: 14px; font-weight: 700; cursor: pointer;
}
.comm-reply-send-btn:active { opacity: .85; }

/* ---- 回复 / 楼中楼 ---- */
.comm-reply, .comm-child { cursor: pointer; }
.comm-reply:active, .comm-child:active { background: rgba(201,151,75,.06); }
.comm-reply {
    background: var(--surface-raised, #171a21); border: 1px solid var(--border, #2a2f3a);
    border-radius: 12px; padding: 12px; margin-bottom: 10px;
}
.comm-reply-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comm-reply-content { font-size: 14px; line-height: 1.7; color: #ccd1db; word-break: break-word; }
.comm-reply-foot { display: flex; align-items: center; gap: 14px; font-size: 12px; color: #8b92a2; margin-top: 6px; }
.comm-child-more { color: #7d8494; }
/* 【展开/收起动画】外层 grid-template-rows: 0fr → 1fr 做高度过渡（无需 JS 量高度），
   内层 overflow:hidden 负责裁剪；不支持该特性的浏览器会直接展开（不影响使用） */
.comm-children {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows .28s cubic-bezier(.4, 0, .2, 1), opacity .22s ease;
}
.comm-children.open {
    grid-template-rows: 1fr;
    opacity: 1;
}
.comm-children-inner {
    overflow: hidden;
    min-height: 0;
    padding-left: 10px;
    padding-top: 10px;      /* 用 padding 而不是 margin：收起时能被 overflow:hidden 完全裁掉 */
    border-left: 2px solid #2a2f3a;
}
/* 展开后按钮上的小箭头跟着转一下，反馈更明显 */
.comm-expand-btn::after { content: ' \25BE'; font-size: 10px; }
.comm-expand-btn[data-expanded="1"]::after { content: ' \25B4'; }
.comm-child { padding: 8px 0; border-bottom: 1px dashed #232833; }
.comm-child:last-child { border-bottom: none; }

/* ---- 发帖 ---- */
.comm-editor-actions { display: flex; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.comm-file-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.comm-editor-images { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.comm-editor-img { position: relative; }
.comm-editor-img img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; }
.comm-editor-img-del {
    position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
    border-radius: 50%; background: #d97268; color: #fff; font-size: 13px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.comm-editor-replay { display: flex; align-items: center; gap: 10px; margin: 6px 0; }

/* ---- 我的创作：我的帖子 ---- */
#my-posts-list .comm-card { margin-bottom: 10px; }
#my-posts-more { width: 100%; margin-top: 6px; }



/* ============================================================
   【楼中楼】A → B 头部 + 展开/收起 + 展开更多
   ============================================================ */
.comm-child-head { display: flex; align-items: center; gap: 8px; }
.comm-child-head .comm-avatar { width: 26px; height: 26px; font-size: 12px; }
.comm-child-head-text { min-width: 0; }
.comm-child-line { font-size: 13.5px; line-height: 1.5; }
.comm-child-from { color: #9ad1ff; font-weight: 600; }
.comm-child-arrow { color: #7d8494; margin: 0 3px; font-size: 12px; }
.comm-child-to { color: #d8b071; font-weight: 600; }
.comm-child-time { font-size: 11.5px; color: #7d8494; margin: 2px 0 4px; }
.comm-child { padding: 9px 0; border-bottom: 1px dashed #232833; }
.comm-children-inner > .comm-child:first-child { padding-top: 2px; }
.comm-child:last-of-type { border-bottom: none; }

.comm-expand-btn {
    color: #c9974b; cursor: pointer; font-size: 12.5px; font-weight: 600;
}
.comm-expand-btn:hover { text-decoration: underline; }
.comm-child-more-btn {
    display: block; width: 100%; margin: 6px 0 2px; padding: 6px 0;
    background: transparent; border: none; color: #c9974b;
    font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left;
}
.comm-child-more-btn:hover { text-decoration: underline; }

/* ============================================================
   【图片查看器】全屏浮层（点任意处 / × / Esc 关闭）
   ============================================================ */
.comm-image-viewer {
    position: fixed; inset: 0; z-index: 9999;
    display: none; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .92);
}
.comm-image-viewer img {
    max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 6px;
}
.comm-image-viewer-close {
    position: absolute; top: 14px; right: 16px;
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.14); color: #fff; font-size: 24px; line-height: 1;
    cursor: pointer;
}

/* ============================================================
   题目评论区「加载更多」：与社区一致的居中文字按钮
   ============================================================ */
.reviews-load-more {
    display: block;
    width: 100%;
    margin: 10px 0 4px;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-top: 1px dashed var(--border, #2a2f3a);
    color: #c9974b;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}
.reviews-load-more:hover { text-decoration: underline; }

/* ============================================================
   【间距修正】我的创作：tabs 与下方「返回 + 搜索」不要贴在一起
   ============================================================ */
#my-creations-tabs {
    margin: 2px 0 16px;
}
#my-posts-panel { margin-top: 4px; }
/* 顺带：社区详情页底部回复栏与正文之间留白（避免最后一屏内容顶到输入框） */
.comm-detail-wrap { padding-bottom: 6px; }

/* ============================================================
   【间距修正·补充】社区各页头部与内容之间留白
   ============================================================ */
.comm-detail-page-head { padding-bottom: 10px; }
.comm-detail-wrap > #comm-replies { margin-top: 2px; }
#page-community .page-head { padding-bottom: 2px; }
#page-community .comm-toolbar { margin-top: 10px; }
#page-community-editor .form-box { margin-top: 6px; }
/* 我的创作：列表与分页栏之间 */
#my-creations-panel > #my-creations-list { margin-bottom: 4px; }
#my-posts-panel #my-posts-list { margin-top: 2px; }

/* ============================================================
   【加好友】社区头像可点击（点它申请加好友）
   ============================================================ */
.comm-avatar-link {
    display: inline-flex;
    flex: 0 0 auto;
    cursor: pointer;
    border-radius: 50%;
    transition: transform .15s ease, box-shadow .15s ease;
}
.comm-avatar-link:hover { transform: scale(1.06); box-shadow: 0 0 0 2px rgba(201,151,75,.55); }
.comm-avatar-link:active { transform: scale(.96); }

/* 人机验证未通过时的提示文案 */
.captcha-gate-tip { color: #d8b071; }

/* ============================================================
   【人机验证】4.0：整条式验证按钮（仿极验自带样式），铺满一行
   ============================================================ */
.captcha-box {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin: 2px 0 14px;
    width: 100%;
}
.captcha-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    padding: 0 14px 0 46px;
    border: 1px solid #e3e6ea;
    border-radius: 6px;
    background: #f7f9fa;
    color: #4a4f57;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: .5px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: background .15s, border-color .15s;
}
.captcha-btn:hover { background: #fff; border-color: #d6dae0; }
.captcha-btn:active { background: #eef1f4; }
/* 左侧小盾牌图标（内联 SVG，不依赖外部资源） */
.captcha-btn::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%234a90e2' d='M12 2l8 4v6c0 5-3.4 8.6-8 10-4.6-1.4-8-5-8-10V6l8-4z'/%3E%3Cpath fill='%23fff' d='M11 8l1.8 1.8 3.2-3.2 1.4 1.4-4.6 4.6L9.6 9.4z'/%3E%3C/svg%3E") no-repeat center/contain;
}
/* 已验证：绿色对勾态 */
.captcha-btn.done {
    background: #f2fbf5;
    border-color: #b7e4c7;
    color: #2f855a;
    font-weight: 600;
}
.captcha-btn.done::before {
    content: "✓";
    background: #48bb78;
    background-image: none;
    color: #fff;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
}
.captcha-status { font-size: 12px; color: #9aa0b0; text-align: left; white-space: pre-line; line-height: 1.6; font-family: ui-monospace, Menlo, Consolas, monospace; }
.captcha-status.err { color: #e0736a; }
.captcha-status.ok { color: #5ad48a; }

/* ============================================================
   【人机验证】容器：只保证容器本身满宽，不强行改极验内部元素
   （之前用 [class*="geetest"]{width:100%} 把底部「极验技术支持」小链接
     也撑满了整块，导致点哪里都会跳官网；加载骨架也被拉得很长）
   ============================================================ */
.captcha-slot { width: 100%; box-sizing: border-box; }
/* 与上方输入框同宽（.form-field input 也是 100%） */
.captcha-slot > div { max-width: 100%; }
/* 极验验证条本身若带固定宽度，铺满容器 */
.captcha-slot > div:not(a) { width: 100%; box-sizing: border-box; }

/* ============================================================
   【人机验证】不再显示验证条：只保留一个隐藏锚点供 SDK 挂载，
   验证面板由「获取验证码」点击时弹出（fully overlay）
   ============================================================ */

.captcha-slot { width: 100%; }



/* ============================================================
   【人机验证】始终显示的验证条：宽度与上方输入框完全一致
   - .form-box 内 input 是 width:100%（含 padding，box-sizing:border-box）
   - 这里让 slot 与输入框同宽，并把极验渲染出的外层容器拉满
     只作用于前两层，且排除 <a>（底部「技术支持」链接，否则会撑满整块并可点跳官网）
   ============================================================ */
.captcha-box {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    margin: 0 0 16px !important;
    overflow: visible !important;
}
.captcha-slot { width: 100% !important; box-sizing: border-box; }
.captcha-slot > *:not(a),
.captcha-slot > *:not(a) > *:not(a) {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
