/* ============================================================
   Asgaros Forum 深色配色适配
   只改颜色（color / background-color / border-color），
   不动尺寸、间距、圆角、布局。

   Asgaros 内部大量写死 #444 文字与 #fff 卡片底，
   在 Puock 的深色页面（#212529）上会出现「白块 + 灰字」。
   ============================================================ */

/* 统一深色判定：body 类 / html 属性 / 兜底写法 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper {
    color: #dee2e6 !important;
}

/* 1. 页面主标题（「论坛」大标题，原来继承 #444，深色下几乎不可见） */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .main-title {
    color: #e9ecef !important;
}

/* 2. 卡片容器：Asgaros 写死白底，深色下改成与主题 .p-block 一致的卡片色 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .content-container,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper #statistics,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper #statistics-body {
    background-color: #343a40 !important;
    color: #dee2e6 !important;
}

/* 在线用户条原来是 #fafafa，深色下压低一档以示区分 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper #statistics-online-users {
    background-color: rgba(0, 0, 0, 0.16) !important;
    color: #adb5bd !important;
}

/* 3. 分节标题条（分类名 / 「最后发表」表头） */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper #forum-header,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .title-element {
    background-color: var(--pk-c-primary, #1c60f3) !important;
    color: #ffffff !important;
}

/* 统计区的深色标题条原来是 #999 灰底白字，深色下发虚 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .title-element-dark {
    background-color: #495057 !important;
    color: #dee2e6 !important;
}

:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .title-element .last-post-headline {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* 4. 论坛行内文字 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .content-element,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .forum-name,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .forum-lastpost-small,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .forum-poster-summary,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .statistics-element {
    color: #dee2e6 !important;
}

/* 次要信息：描述、统计数字、占位提示 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper small,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .forum-description,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .forum-stats,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .no-topics,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .element-name,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper #forum-breadcrumbs,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper #forum-breadcrumbs a {
    color: #adb5bd !important;
}

/* 统计数字是重点信息，比说明文字亮一档 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .element-number {
    color: #e9ecef !important;
}

/* 5. 链接：Asgaros 的 #256db3 深蓝在深底上对比不足，换成浅蓝 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper a {
    color: #6ea8fe !important;
}

/* 管理员高亮用红，深底上提亮 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .profile-link.highlight-admin,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .profile-link.highlight-admin:hover {
    color: #ff8787 !important;
}

/* 论坛状态图标（未读 / 已读）跟随链接色 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .forum-status i {
    color: #6ea8fe !important;
}

/* 6. 提示条：原来是浅黄底 + 暗黄字 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .notices-panel,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .notices-panel .notice {
    background-color: rgba(255, 193, 7, 0.12) !important;
    border-color: rgba(255, 193, 7, 0.3) !important;
    color: #ffd75e !important;
}

:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .notices-panel a {
    color: #ffd75e !important;
}

/* 7. 搜索框（原来透明底，深色下缺少边界） */
/* #forum-search 自身是 #fff 的胶囊容器，只改里面 input 会剩下一圈白边 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper #forum-search {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper #forum-search input,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper input:is([type="text"], [type="search"]),
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper input[type="search"],
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper textarea,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper select {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #dee2e6 !important;
}

:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper input::placeholder,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper textarea::placeholder {
    color: #868e96 !important;
}

/* 8. 分隔线与行边框 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .content-element,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .content-element .forum-name,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .statistics-element,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper table,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper td,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper th {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* 9. 帖子 / 主题列表页（表头原来是浅灰底深字） */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper th,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .topic-starter,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-header,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-footer {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: #dee2e6 !important;
}

/* .post-content 是 3.x 之前的正文容器，3.5 改成 .post-message，两个都留着 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-content,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-message,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-wrapper,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post {
    background-color: transparent !important;
    color: #dee2e6 !important;
}

/* 10. 插件写死的浅色底块（偶数行条纹、表头工具条、编辑器条、资料卡、反应汇总）
   原来都是 #fafafa / #fff，深色下会变成亮块，这里统一压深 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .content-element:nth-child(even),
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .forum-post-header-container,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .editor-element,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper #profile-layer,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper #profile-content,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-reactions-summary .reaction-names {
    background-color: rgba(0, 0, 0, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #dee2e6 !important;
}

/* 帖子卡片原来白底 + 白色描边阴影，深色下改成浮起一档的卡片色 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-element {
    background-color: #3a4148 !important;
    color: #dee2e6 !important;
    box-shadow: rgba(0, 0, 0, 0) 0 0 0 0, rgba(255, 255, 255, 0.12) 0 0 0 1px, rgba(0, 0, 0, 0) 0 0 0 0 !important;
}

/* 11. 按钮：只调整配色，保持原有尺寸与圆角 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .button,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper input[type="submit"],
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper button {
    border-color: var(--pk-c-primary, #1c60f3) !important;
    background-color: var(--pk-c-primary, #1c60f3) !important;
    color: #ffffff !important;
}

:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .button:hover,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper input[type="submit"]:hover,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper button:hover {
    filter: brightness(1.1);
}

/* 12. 帖子页的次要信息（发帖日期、@提及名），原来写死 #888 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .forum-post-date,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .mention-nice-name,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-author-block-name,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-counter {
    color: #adb5bd !important;
}

/* 13. 顶 / 踩计数：半透明红绿在深色卡片上过暗，提亮但保持红绿语义 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-reactions .reaction.up .reaction-number,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-reactions .reaction.up .reaction-active {
    color: #69db7c !important;
}

:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-reactions .reaction.down .reaction-number,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .post-reactions .reaction.down .reaction-active {
    color: #ff8787 !important;
}

/* 14. 发帖 / 回复框用的是 WordPress 经典编辑器，
   工具条、容器、文本域全是硬编码浅色，深色下是一整块白 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .wp-editor-tabs button,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .quicktags-toolbar,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .mce-toolbar-grp,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .mce-statusbar,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .mce-panel {
    background-color: #2b3035 !important;
    border-color: #495057 !important;
    color: #ced4da !important;
    text-shadow: none !important;
}

:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper #wp-message-wrap,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper #wp-message-editor-container,
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .wp-editor-container {
    background-color: #212529 !important;
    border-color: #495057 !important;
}

:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper .wp-editor-area {
    background-color: #212529 !important;
    color: #dee2e6 !important;
    border-color: #495057 !important;
    -webkit-text-fill-color: #dee2e6;
}

/* 15. 头像：插件给 #af-wrapper img.avatar 写了 #fff 底，
   带透明通道的头像在深色下会露出一块白方块 */
:is(body.puock-dark, html[data-bs-theme="dark"], html:has(body.puock-dark)) #af-wrapper img.avatar {
    background-color: transparent !important;
}
