/*
 * Discuz 原生类名兼容层
 * 没有逐页重写的页面（设置、群组、弹窗、管理面板……）输出的是 Discuz 自己的类名，
 * 这里把它们接到新模板的色彩变量和组件样式上。颜色大多已经通过风格变量指向 var(--*)，
 * 这里主要处理背景图、边框样式、尺寸和圆角。
 */

/* 布局 */
.wp, #wp { width: auto; min-width: 0; margin: 0; }
/* 内容区跟设计稿一样铺满，不限宽 */
.ct2 .mn { width: calc(100% - 252px); }
.ct2 .sd { width: 220px; }
.mn, .sd { box-sizing: border-box; }
.frame, .area, .column { min-height: 0; }

/* 区块 */
.bm { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin-bottom: 16px; overflow: hidden; }
/* 卡片里再套的 .bm（插件常这么写）只当普通容器，不再画一层外框 */
.bm .bm { border: 0; border-radius: 0; background: transparent; margin-bottom: 0; }
.bm_h { height: auto; min-height: 48px; line-height: 48px; padding: 0 20px; border-top: 0; border-bottom: 1px solid var(--line); background: transparent; }
.bm_h h2, .bm_h h3 { font-size: 15px; font-weight: 600; }
/* 收起/展开图标：默认样式是 margin-top: 8px 顶着放，标题栏加高后就偏上了，改成跟标题栏等高再垂直居中 */
.bm_h .o { display: flex; align-items: center; justify-content: flex-end; min-height: inherit; }
.bm_h .o img { float: none; margin: 0; }
.bm_c { padding: 16px 20px; }
.bml .bm_h { padding: 0 20px; }
.bw0, .bw0_all { border: 0; background: transparent; }
.bbda { border-bottom: 1px solid var(--line); }
.bn { margin-bottom: 16px; }
.xi2, .xi2 a, .xi3 a { color: var(--ink); }

/* 面包屑 */
#pt { height: auto; margin: 0 0 16px; line-height: 1.6; font-size: 13px; color: var(--text-3); }
#pt .z a, #pt .z em, #pt .z span { float: none; height: auto; display: inline; }
#pt .z em { width: auto; background: none; line-height: inherit; overflow: visible; margin: 0 6px; font-size: 0; }
#pt .z em::before { content: "/"; font-size: 13px; color: var(--text-3); }
#pt .nvhm { width: auto; background: none; text-indent: 0; overflow: visible; }
#pt .nvhm::before { content: "首页"; }
#pt .nvhm { font-size: 0; }
#pt .nvhm::before { font-size: 13px; }

/* 按钮 */
.pn { height: 36px; padding: 0 14px; margin-right: 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: none; color: var(--text); font: 600 14px var(--font); overflow: visible; }
.pn:hover { background: var(--hover); }
.pn:active { background-position: 0 0; transform: translateY(1px); }
.pn em, .pn span, .pn strong { padding: 0; line-height: 34px; font-weight: 600; }
.pnc, a.pnc { border-color: var(--text); background: var(--text); }
.pnc:hover { background: var(--text); opacity: .88; }
a.pn { display: inline-flex; align-items: center; height: 36px; box-sizing: border-box; }
.pns .pn { margin-right: 6px; }
.pnpost .pn { height: 36px; }

/* 输入框 */
.px, textarea.pt, .ps, select { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: 14px var(--font); box-sizing: border-box; }
.px, textarea.pt { padding: 8px 12px; line-height: 20px; }
.px { height: 38px; }
.ps, select { height: 38px; padding: 0 10px; }
.px:focus, textarea.pt:focus, .ps:focus, select:focus { border-color: var(--brand); box-shadow: var(--ring); outline: none; }
.pc, .pr { accent-color: var(--text); width: 15px; height: 15px; vertical-align: -2px; }
/* simulateSelect() 模拟的下拉：原生 select 被藏起来，换成 .ftid 里的一个 a（显示框）+ body 下的 .sltm（选项列表）。
 * 原版是 21px 高的灰框配 newarow.gif 箭头（图路径在新模板下还是坏的），这里画成和 .ps 一样的输入框；
 * 宽度是脚本按 select 的 width 属性写的行内样式，只能用 min-width 往上撑 */
.ftid a { position: relative; display: flex; align-items: center; box-sizing: border-box; min-width: 160px; height: 38px; padding: 0 32px 0 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface) none; color: var(--text); font: 14px/1 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftid a::after { content: ""; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); }
.ftid a:focus-visible { border-color: var(--brand); box-shadow: var(--ring); outline: none; }
.sltm { box-sizing: border-box; min-width: 160px; max-height: 320px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-pop); }
.sltm ul { margin: 0; padding: 0; list-style: none; }
.sltm li { padding: 7px 10px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.4; color: var(--text-2); cursor: pointer; }
.sltm li:hover { background: var(--hover); color: var(--text); }
.sltm li.current { color: var(--text); font-weight: 600; }
.tfm th, .tfm td { padding: 10px 0; }
.tfm th { color: var(--text-2); font-weight: 500; }
.tfm .d { color: var(--text-3); font-size: 12.5px; }

/* 标签页 */
.tb { margin-top: 0; padding-left: 0; line-height: 44px; border-bottom: 1px solid var(--line); display: flex; gap: 24px; flex-wrap: wrap; }
.tb li { float: none; margin: 0; }
.tb a { padding: 0; border: 0; background: transparent; color: var(--text-3); font-weight: 500; position: relative; }
.tb a:hover { color: var(--text); }
.tb .a a, .tb .current a { background: transparent; color: var(--text); font-weight: 600; }
.tb .a a::after, .tb .current a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); border-radius: 2px; }
.tb .y { margin-left: auto; }
.tb .o, .tb .o a { height: 32px; line-height: 32px; border: 0; background: var(--text); color: var(--bg); border-radius: var(--r-sm); }
.tb .o { align-self: center; }
.tb .o a { padding: 0 14px; }

/* 分页 */
.pg, .pgs .pg { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; float: none; }
.pg a, .pg strong { float: none; height: 34px; min-width: 34px; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; display: inline-grid; place-items: center; box-sizing: border-box; font: 500 13px var(--mono); color: var(--text-2); line-height: 34px; margin: 0; }
.pg a:hover { background: var(--hover); color: var(--text); }
.pg strong { background: var(--text); color: var(--bg); }
.pg .nxt, .pg .prev { background-image: none; padding: 0 12px; font-family: var(--font); }
/* 核心 helper_page 在 PC 端把「上一页」写死成 &nbsp;&nbsp;，原版靠背景箭头图显示；背景图去掉后只剩空块，这里藏掉空格补上文字 */
.pg .prev { font-size: 0; }
.pg .prev::before { content: "上一页"; font-size: 13px; }
.pg .last { padding: 0 10px; }
/* 跳页：输入框 + 「/ 共 N 页」+ 跳转按钮（按钮由 klp.js 补上）合成一个胶囊 */
.pg label { float: none; display: inline-flex; align-items: center; gap: 2px; height: 34px; margin: 0 0 0 6px; padding: 0 3px 0 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-sizing: border-box; overflow: visible; font: 500 13px var(--mono); color: var(--text-3); line-height: 1; cursor: text; transition: border-color .15s, box-shadow .15s; }
.pg label:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.pg label .px { float: none; height: 26px; width: 40px; min-width: 0; padding: 0 4px; margin: 0; border: 0; border-radius: 6px; background: transparent; box-shadow: none; text-align: center; font: 500 13px var(--mono); color: var(--text); }
.pg label .px:focus { border: 0; box-shadow: none; background: var(--hover); }
.pg label span { display: inline; float: none; height: auto; padding: 0 6px 0 2px; margin: 0; border: 0; background: none; white-space: nowrap; font-family: var(--font); color: var(--text-3); }
.pg .klp-pg-go { height: 26px; padding: 0 10px; margin: 0; border: 0; border-radius: 7px; background: var(--hover); color: var(--text); font: 500 12.5px var(--font); cursor: pointer; white-space: nowrap; }
.pg .klp-pg-go:hover { background: var(--text); color: var(--bg); }
.pgs { display: flex; align-items: center; gap: 8px; }

/* 下拉 / 弹层 */
.p_pop, .p_pof, .sllt { padding: 6px; border: 0; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-pop); min-width: 140px; }
.p_pop a { padding: 7px 10px; border-bottom: 0; border-radius: 8px; color: var(--text-2); }
.p_pop a:hover, .p_pop a.a, #sctype_menu .sca { background: var(--hover); color: var(--text); text-decoration: none; }
.p_pop li { display: block; }
/* 发新帖菜单：module.css 把类型小图标画在 li 背景上、靠 a 的 30px 左内边距让位，上面 .p_pop a 把内边距改小后图标压到了字上。
 * 悬停底色也挪到 li 上，否则 a 的底色会盖住图标；插件主题类型的图标是 li 行内 background-image，同样适用 */
#newspecial_menu li { background-position: 10px 50%; border-radius: 8px; }
#newspecial_menu li:hover { background-color: var(--hover); }
#newspecial_menu a { padding-left: 34px; }
#newspecial_menu a:hover { background: none; }
.p_opt { padding: 12px; }
/* 出场动画（规范见 README「动效规范」）：Discuz 的 showMenu 每次弹出都是把 display 从 none 改回来，CSS 动画会自然重播。
 * 这些弹层靠 left / top 定位、Discuz 用 offsetWidth 算尺寸，都不受 transform 影响，所以缩放不会让位置算偏。
 * 收起由 Discuz 直接 display: none，这边不接管。 */
.p_pop, .p_pof, .sllt, .tip, .fwinmask { animation: klpPop var(--dur-2) var(--ease); }
/* .fwinmask 是 showWindow 弹窗本体的类名，不是遮罩；遮罩是 #xxx_cover（行内样式，写死 50% 纯黑），
 * 现在统一由 klp.js 的 .klp-veil 代替（跟着主题换色、淡入淡出），原遮罩在本文件末尾的 klp-fix 层里藏掉 */
.fwinmask { background: transparent; }
.fwin .flb, .flb { padding: 16px 20px 8px; height: auto; line-height: 1.5; font-size: 16px; font-weight: 600; }
.flb em { font-size: 16px; }
/* 标题栏横排：标题占满、关闭按钮靠右。原版靠 span 浮动，弹窗按最窄宽度排时标题会被挤成竖排 */
.fwin .flb { display: flex; align-items: center; gap: 12px; }
.fwin .flb > em { flex: 1 1 auto; min-width: 0; }
.fwin .flb > span { flex: none; margin-left: auto; display: flex; align-items: center; gap: 4px; }
/* showDialog('', 'info', '<img loading.gif> 请稍候...')：提示语放在标题里，不能折行，也不该用标题的强调色 */
#fwin_dialog .flb > em { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
#fwin_dialog .flb > em:has(> img[src*="loading"]) { font-size: 14px; font-weight: 500; color: var(--text-2); }
.flb .flbc { width: 30px; height: 30px; border-radius: 8px; background: transparent; text-indent: 0; font-size: 0; overflow: hidden; position: relative; }
.flb .flbc::before { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; color: var(--text-3); }
.flb .flbc:hover { background: var(--hover); }
.fwin .m_c, .m_c { padding: 8px 20px 16px; }
.fwin .o, .m_c .o { padding: 12px 20px; border-top: 1px solid var(--line); background: transparent; }
.fwin { border-radius: 16px; }
table.fwin > tbody > tr > td.t_l, table.fwin > tbody > tr > td.t_c, table.fwin > tbody > tr > td.t_r, table.fwin > tbody > tr > td.m_l, table.fwin > tbody > tr > td.m_r, table.fwin > tbody > tr > td.b_l, table.fwin > tbody > tr > td.b_c, table.fwin > tbody > tr > td.b_r { background: none; width: 0; height: 0; padding: 0; }
table.fwin > tbody > tr > td.m_c { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-pop); }
/* 弹窗标题：Discuz 给 .flb em 上的是风格强调色，在新模板里会映射成青绿，一眼看过去像链接。
 * 所有弹窗标题统一回正文色（原来只给 .tm_c 改过一处，这里收口） */
.flb em { color: var(--text); }

/* 提示 / 确认弹窗（showmessage、showDialog 的 .c.altw）：站内最常见的一类浮层。
 * 原版靠 .alert_right / .alert_error / .alert_info 的背景图画状态图标，图路径在新模板下失效，
 * 只剩一行裸文字，这里用纯 CSS 补一个圆形图标，间距也收匀 */
.fwin .c.altw { padding: 4px 20px 14px; }
.c.altw .alert_info, .c.altw .alert_right, .c.altw .alert_error { position: relative; min-height: 26px; padding: 0 0 0 36px; }
.c.altw .alert_info::before, .c.altw .alert_right::before, .c.altw .alert_error::before { position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--font); }
.c.altw .alert_info::before { content: "i"; background: var(--info-soft); color: var(--info); }
.c.altw .alert_right::before { content: "¹3"; background: var(--ok-soft); color: var(--ok); }
.c.altw .alert_error::before { content: "!"; background: var(--danger-soft); color: var(--danger); }
.c.altw p { margin: 0; font-size: 14px; line-height: 26px; color: var(--text); }
.c.altw p + p { margin-top: 6px; line-height: 1.7; }
.c.altw .alert_btnleft { margin-top: 8px; font-size: 13px; color: var(--text-3); }
.c.altw a { color: var(--ink); }
/* 只有一个「确定」时按钮靠右；确认框的「取消」跟在后面。
 * 原版 .m_c .o 写死 height: 26px，只装得下 .pn；换成 .k-btn（如购买勋章）会伸出弹窗底边，高度放开 */
.fwin .o.pns { display: flex; align-items: center; justify-content: flex-end; gap: 8px; height: auto; }
.fwin .o.pns button.pn { margin: 0; }

/* 弹窗里的记录表（查看评分、撤销评分、警告记录、主题操作日志……）：原版 .list 是无边框裸表格；
 * .floatwrap 还写死了 280px 高，记录少时下面全是空白 */
.m_c .floatwrap { height: auto; max-height: 50vh; overflow-y: auto; }
/* 弹窗宽度是内容撑出来的，表格写 width:100% 会让每列挤成竖排字，这里按内容排，只有最后一列（理由）允许折行 */
.m_c table.list { width: auto; min-width: 320px; border-collapse: collapse; font-size: 13px; }
.m_c table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.m_c table.list td:last-child { white-space: normal; min-width: 120px; }
.m_c table.list thead td { position: sticky; top: 0; background: var(--surface); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.m_c table.list tbody tr:hover { background: var(--hover); }
.m_c table.list .xw1, .m_c table.list strong { font-family: var(--mono); font-weight: 600; color: var(--text); }

/* 举报弹窗（common/report.htm）：原版是 label + <br> 堆的单选列表，点击区只有文字那一小段 */
.reason_slct > p:first-child { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--text-3); }
#report_reasons { display: grid; gap: 2px; }
#report_reasons br { display: none; }
#report_reasons label { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r-sm); font-size: 14px; color: var(--text); cursor: pointer; }
#report_reasons label:hover { background: var(--hover); }
#report_reasons input.pr { flex: none; margin: 0; }
#report_other { margin-top: 10px; }
#report_other textarea.pt { display: block; width: 100%; min-height: 88px; margin: 0; resize: vertical; }
#report_msg { display: block; margin-top: 6px; font-size: 12.5px; color: var(--text-3); }
#report_msg strong { font-family: var(--mono); color: var(--text-2); }

/* 收藏弹窗（spacecp_favorite）：两行说明 + 一个文本框 */
form[id^="favoriteform_"] .c p { margin: 0; font-size: 13px; color: var(--text-2); }
form[id^="favoriteform_"] .c p + p { margin-top: 12px; }
form[id^="favoriteform_"] .c p strong { color: var(--text); }
form[id^="favoriteform_"] textarea.pt { display: block; min-height: 96px; margin-top: 8px; resize: vertical; }

/* 加好友弹窗（spacecp_friend op=add）：头像一列 + 附言、分组一列 */
/* 弹窗宽度由内容撑开，输入框改成占满后 table 会缩成一条，给它一个固定宽度 */
form[id^="addform_"] .c table { width: 360px; max-width: 100%; }
form[id^="addform_"] .c th.avt { width: 56px; padding: 0 12px 0 0; }
form[id^="addform_"] .c th.avt img { width: 44px; height: 44px; border-radius: var(--r-md); }
form[id^="addform_"] .c td { font-size: 14px; line-height: 1.6; color: var(--text-2); }
form[id^="addform_"] .c td strong { color: var(--text); }
form[id^="addform_"] .c input.px { display: block; width: 100%; margin-top: 8px; }
form[id^="addform_"] .c p.xg1 { margin: 6px 0 0; font-size: 12.5px; color: var(--text-3); }
form[id^="addform_"] .c p.mtm { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 13px; white-space: nowrap; }

/* 版主操作 / 图章 / 评分弹窗（topicadmin、topicadmin_action、rate 的 .tm_c）：
 * .tm_c 自带标题栏和底栏，外层 td.m_c 再加一圈内边距，标题就缩进两次、灰底栏也够不到边 */
table.fwin td.m_c:has(> .tm_c) { padding: 0; }
.tm_c { min-width: 340px; max-width: 520px; background: transparent; }
.tm_c .flb em { color: var(--text); }
.tm_c .flb em.onerror { font-size: 14px; font-weight: 500; color: var(--danger); }
.tm_c .c { padding: 4px 20px 16px; }
.tm_c .o { display: flex; align-items: center; justify-content: flex-end; gap: 12px; height: auto; margin: 0; padding: 12px 20px; border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; background: transparent; }
.tm_c .o label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--text-2); }
.tm_c .o label.z { margin-right: auto; }
.tm_c .o .pn { margin: 0; }
.tm_c .ps, .tm_c select { min-width: 180px; max-width: 100%; }
/* 弹窗窄的时候，「提升主题」这种带单选的短标签会被挤成一列竖排字 */
.tm_c label { white-space: nowrap; }
.tm_c .tplw label { display: inline-flex; align-items: center; gap: 6px; }
/* 版务操作面板（topicadmin moderate：置顶 / 精华 / 提升 / 高亮 / 移动 / 分类……）：
 * 一行一个「勾选 + 该项的参数」，原版是 table 套 table 排出来的，间距和控件尺寸都不一致 */
/* 注意别把 td 改成 flex、也别改 vertical-align：这几层是 table 排的版，
 * td 一旦垂直居中，勾选框就会跑到展开后的整块参数的中间高度去，和标题分家 */
.tm_c ul.tpcl { margin: 0; padding: 0; list-style: none; }
.tm_c ul.tpcl > li + li { border-top: 1px dashed var(--line); }
.tm_c ul.tpcl input.pc { margin-top: 2px; }
.tm_c .labeltxt { font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
/* 展开逻辑：原版 switchitemcp 同一时间只给一个 li 加 .copt，li 又写死 28px 高，
 * 于是勾了「置顶 + 精华」两项时，先勾的那项的下拉会被截掉——看起来就是勾了却没处选级别。
 * 这里改成跟着勾选状态走，勾上哪项就展开哪项的参数，可以同时展开多项 */
.tm_c ul.tpcl > li { height: auto; }
.tm_c ul.tpcl .dopt { visibility: visible; }
.tm_c ul.tpcl div.dopt { display: none; }
.tm_c ul.tpcl tr.dopt { display: none; }
/* 点标题（原版的 switchitemcp 会给 li 加 .copt）也能展开，勾选的则一直展开 */
.tm_c ul.tpcl > li:has(input:checked) div.dopt, .tm_c ul.tpcl > li.copt div.dopt { display: inline-block; margin-left: 10px; vertical-align: middle; }
.tm_c ul.tpcl > li:has(input:checked) tr.dopt, .tm_c ul.tpcl > li.copt tr.dopt { display: table-row; }
/* 原版把 label 写成 display:block;width:100%（背景还是一张取不到的箭头图），展开时再靠 .copt
 * 改成 float:left;width:45px。既然改成按勾选状态展开，label 就固定成行内元素，
 * 否则它占满整行，会把同一格里的下拉挤成 0 宽 */
.tm_c ul.tpcl .labeltxt { display: inline-block; float: none; width: auto; background: none; vertical-align: middle; }
.tm_c .dopt select, .tm_c .dopt .ps { height: 32px; min-width: 120px; }
.tm_c p.hasd { display: flex; align-items: center; gap: 8px; margin: 0; }
.tm_c span.hasd { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
/* 原版给这些输入框写了 float:left，跟上面的 flex 一起用会错位 */
.tm_c .hasd input.px { float: none; width: 150px; height: 32px; }
/* 高亮项的三个样式开关（取色块在文件末尾的 klp-fix 层里处理，common.css 给它写了 !important） */
.tm_c a[id^="highlight_op_"] { box-sizing: border-box; display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); font-size: 14px; }
.tm_c a[id^="highlight_op_"]:hover { background: var(--hover); color: var(--text); }
.tm_c a[id^="highlight_op_"].cnt { border-color: transparent; background: var(--soft); color: var(--soft-ink); }

/* 合并 / 复制 / 分割 / 警告这些弹窗的表单也是 table 排的，统一单元格间距和控件尺寸 */
.tm_c .tplw table { width: 100%; }
.tm_c .tplw td { padding: 3px 8px 3px 0; vertical-align: middle; font-size: 13px; color: var(--text-2); }
.tm_c .tplw label { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; }
.tm_c .tplw input.px { box-sizing: border-box; width: 100%; height: 34px; }
.tm_c .tplw select, .tm_c .tplw .ps { height: 34px; }
.tplw { margin-bottom: 14px; }
.tplw > p:first-child, .tpclg h4 { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.tpclg { padding: 0; }
.tpclg h4 { display: flex; align-items: center; justify-content: space-between; width: auto; }
.tpclg h4 .dpbtn { order: 2; }
/* 删除主题弹窗的「用户操作: 禁言 / 清空帖子」：原版靠 .y 的 float:right 排右边，h4 改成 flex 后
 * 浮动失效，复选框反而跑到了标题前面 */
.tpclg h4 .y { order: 2; float: none; margin-left: auto; display: flex; align-items: center; gap: 12px; }
.tpclg h4 .y label { display: inline-flex; align-items: center; gap: 5px; margin: 0; }
.tm_c textarea.pt { display: block; width: 100%; min-height: 84px; margin: 0; resize: vertical; }
/* 下拉小按钮（预设理由、有效期、评分分值）：原版是 newarow.gif 背景图，IMGDIR 在新模板下路径失效，只剩一个空方框 */
.dpbtn { position: relative; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.dpbtn::before { content: ""; position: absolute; left: 50%; top: 45%; width: 6px; height: 6px; border: solid var(--text-3); border-width: 0 1.5px 1.5px 0; transform: translate(-50%, -50%) rotate(45deg); }
.dpbtn:hover { background: var(--hover); border-color: var(--text-3); }.tip { border: 0; border-radius: 10px; background: var(--text); color: var(--bg); padding: 6px 10px; }
.tip_horn { display: none; }
/* 全局提示 showPrompt / showCreditPrompt / showDialog(..., closetime)（复制地址成功、积分变动等）：
 * 结构是 #ntcwin.ntcwin 或 .popuptext > table.popupcredit > td.pc_l / td.pc_c > div.pc_inner / td.pc_r，
 * 原版靠三段背景图拼一个深色胶囊、文字写死 #FFEA97 黄，背景图去掉后就成了白底上的黄字。
 * 这里换成和 .k-toast 一样的深色提示条；位置仍由 Discuz 的 showMenu 按屏幕居中计算，不接管。 */
.ntcwin, .popuptext { animation: klpPop var(--dur-2) var(--ease); }
table.popupcredit { border-collapse: separate; border-spacing: 0; background: var(--text); color: var(--bg); border-radius: 12px; box-shadow: var(--shadow-pop); }
table.popupcredit td.pc_l, table.popupcredit td.pc_r { display: none; }
table.popupcredit td.pc_c, table.popupcredit .pc_inner { width: auto; height: auto; line-height: 1.5; background: none; }
table.popupcredit .pc_inner { padding: 12px 16px; font-size: 13.5px; white-space: nowrap; text-align: center; }
table.popupcredit .pc_inner i { margin-right: 8px; font-size: 12.5px; font-style: normal; color: inherit; opacity: .7; }
table.popupcredit .pc_inner span { margin: 0; color: inherit; font-size: 13.5px; font-weight: 500; }
table.popupcredit .pc_inner span + span { margin-left: 12px; }
table.popupcredit .pc_inner span a { color: inherit; text-decoration: underline; }
table.popupcredit .pc_inner span em, table.popupcredit .pc_inner span em.desc { margin-left: 2px; color: inherit; font: 600 15px var(--mono); }

/* 提示信息页（showmessage） */
/* 原版 .nfl .f_c 自带 4px 灰边和白底，会跟卡片叠成两层框，这里清掉只留卡片 */
.nfl { height: auto; padding: 72px 0 96px; }
.nfl .f_c { box-sizing: border-box; width: auto; max-width: 520px; margin: 0 auto; padding: 0; border: 0; background: transparent; }
.alert_right, .alert_error, .alert_info { background-image: none; padding-left: 0; }
.k-msg { position: relative; padding: 32px 32px 28px 84px; min-height: 36px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--text); }
.k-msg::before { content: "i"; position: absolute; left: 32px; top: 28px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 17px var(--font); background: var(--info-soft); color: var(--info); }
.k-msg.alert_error::before { content: "!"; background: var(--danger-soft); color: var(--danger); }
.k-msg.alert_right::before { content: "✓"; background: var(--ok-soft); color: var(--ok); }
.k-msg p { margin: 0; font-size: 15px; line-height: 1.7; }
.k-msg > p:first-child { padding-top: 6px; font-weight: 500; }
.k-msg .alert_btnleft { margin-top: 10px; font-size: 13px; color: var(--text-3); }
.k-msg .alert_btnleft a { color: var(--ink); font-weight: 500; }
.k-msg-act { display: flex; gap: 8px; margin-top: 20px; }
#messagelogin { margin-top: 16px; }

/* 通用列表与表格 */
.tl th, .tl td { border-bottom: 1px solid var(--line); padding: 12px 8px; }
.tl .th th, .tl .th td { background: transparent; color: var(--text-3); font-weight: 500; }
.dt { border-top: 1px solid var(--line); }
.dt th { background: transparent; border-bottom: 1px solid var(--line); color: var(--text-3); font-weight: 500; }
.dt td { border-bottom: 1px solid var(--line); padding: 10px 6px; }
.xl li { padding: 6px 0; }
.bbda, .btda { border-color: var(--line); }
.quote { background: var(--hover); border: 0; border-radius: 12px; padding: 12px 16px; }
.quote blockquote { background: none; padding: 0; margin: 0; }
.blockcode { background: var(--hover); border: 0; border-radius: 12px; padding: 12px 16px; }
.blockcode ol li { font-family: var(--mono); font-size: 13px; color: var(--text); }
.showhide { background: var(--hover); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 16px; }
.locked { background: var(--warn-soft); border: 1px dashed var(--warn-line); border-radius: 12px; padding: 12px 16px; color: var(--warn); }

/* 编辑器（发帖 / 回帖）：只做外观，结构保持原样 */
.edt, .tedt { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.edt .bar, .tedt .bar { border-bottom: 1px solid var(--line); background: var(--surface); }
.edt .area, .tedt .area { background: var(--surface); }
textarea.pt, .edt textarea, .tedt textarea { background: var(--surface); color: var(--text); }

/* 回到顶部
 * Discuz 的 showTopLink() 按 #ft 的宽度往行内写 left；有右栏的页面 #ft 是隐藏的（宽 0），
 * 算出来是 left: -2000px 上下，按钮整个跑到屏幕外，所以位置要用 !important 固定住。
 * 显隐也是它改行内 visibility，这里按行内值做淡入淡出：隐藏时 visibility 延后切换，等淡出播完。 */
#scrolltop.klp-scrolltop { position: fixed; left: auto !important; right: 24px !important; bottom: 32px; z-index: 50; visibility: hidden; border: 0; background: none; width: auto; opacity: 0; transform: translateY(8px) scale(.96); transition: opacity var(--dur-2) var(--ease-io), transform var(--dur-2) var(--ease), visibility 0s linear var(--dur-2); }
#scrolltop.klp-scrolltop[style*="visible"] { opacity: 1; transform: none; transition: opacity var(--dur-2) var(--ease-io), transform var(--dur-2) var(--ease), visibility 0s; }
#scrolltop.klp-scrolltop a { width: 40px; height: 40px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); display: grid; place-items: center; color: var(--text-2); }
#scrolltop.klp-scrolltop a b { display: none; }

/* 插件嵌入到侧栏 / 菜单里的原生链接 */
.klp-usernav-hook:empty { display: none; }
/* 旧版顶栏用的竖线分隔符在菜单里多余；qqconnect 的「QQ帐号绑定」小图在新版菜单里不放（旧版仍显示，所以不改插件） */
.klp-usernav-hook .pipe, .klp-usernav-hook a[href^="connect.php?mod=config"] { display: none; }
.klp-usernav-hook a { display: flex; align-items: center; min-height: 32px; padding: 0 10px; border-radius: var(--r-sm); font-size: 13px; color: var(--text-2); }
.klp-usernav-hook a:hover { background: var(--hover); }
.klp-login-extra:empty { display: none; }
.klp-login-extra img { vertical-align: middle; }
#loginstatus a { color: var(--text-2); }

/* 面包屑：原生页面用的是 #pt.bm（带卡片样式），这里压平 */
#pt, #pt.bm { background: none; border: 0; padding: 0; margin: 0 0 16px; height: auto; min-height: 0; box-shadow: none; }
#pt .z { float: none; height: auto; padding: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 0; }
#pt .z a, #pt .z em, #pt .z span { float: none; height: auto; line-height: 1.6; }

/* 私聊弹窗（home.php?mod=spacecp&ac=pm&op=showmsg，showWindow 打开；模板沿用 default/home/spacecp_pm.htm）：
 * 原版是灰渐变标题栏 + 橙色气泡，全靠 pm.png / pm-bg*.png 背景图，这里整套换成聊天气泡。
 * .pmt 是作者名，原版用 text-indent 藏起来只露气泡尖角，左右靠 .pmm 区分，这里同样不显示名字。 */
table.fwin td.m_c:has(> .pm) { padding: 0; }
.pm { box-sizing: border-box; width: 440px; max-width: calc(100vw - 32px); border-radius: 16px; background: var(--surface); }
.pm .flb { margin: 0; padding: 14px 16px 6px 20px; background: none; }
.pm .flb em { padding: 0; background: none; text-shadow: none; color: var(--text); font-size: 15px; font-weight: 600; }
.pm_tac { display: flex; align-items: center; gap: 12px; padding: 0 20px 12px; border-bottom: 1px solid var(--line); background: none; font-size: 12.5px; }
.pm_tac a { color: var(--text-3); }
.pm_tac a:hover { color: var(--ink); text-decoration: none; }
.pm_tac a.y { order: 2; float: none; margin-left: auto; }
.pm .c { padding: 0; background: none; }
.pmb { box-sizing: border-box; width: auto; height: 320px; margin: 0; padding: 14px 16px 6px; background: var(--bg); scrollbar-width: thin; }
/* 一条聊天记录都没有时别留一大块空白 */
.pmb:empty { display: grid; place-items: center; font-size: 13px; color: var(--text-3); }
.pmb:empty::after { content: "还没有聊天记录"; }
.pmb li { display: flex; margin: 0 0 8px; }
.pmb li::after { display: none; }
.pmb h4 { margin: 2px auto 6px; padding: 2px 10px; border-radius: 999px; background: var(--hover); color: var(--text-3); font: 500 11.5px var(--mono); }
.pmt { display: none; }
.pmd { float: none; max-width: 78%; box-sizing: border-box; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; background: var(--surface); box-shadow: none; color: var(--text); font-size: 13.5px; line-height: 1.6; word-wrap: break-word; overflow-wrap: anywhere; }
.pmd img { max-width: 100%; height: auto; }
.pmm { justify-content: flex-end; }
.pmm .pmd { float: none; border-color: transparent; border-radius: 14px 14px 4px 14px; background: var(--soft); box-shadow: none; color: var(--soft-ink); }
.pmd .quote { margin: 2px 0 4px; padding: 0 0 0 8px; border-left: 3px solid var(--line); background: none; color: var(--text-2); }
.pmd .quote blockquote { display: block; padding: 0; background: none; }
.pmd .blockcode { margin: 4px 0; padding: 6px 8px; border-radius: var(--r-sm); background: var(--hover); color: var(--text); }
.pmd .blockcode code { font: 12px/1.7 var(--mono); }
.pmfm { padding: 12px 16px 16px; border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; background: var(--surface); }
.pmfm [id^="return_"] { margin: 0 0 8px; font-size: 12.5px; }
.pmfm [id^="return_"]:empty { display: none; }
.pmfm .tedt, .tfm .tedt { width: auto; border-radius: var(--r-md); transition: border-color var(--dur-1) var(--ease-io), box-shadow var(--dur-1) var(--ease-io); }
.pmfm .tedt:focus-within, .tfm .tedt:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.pmfm .tedt .bar, .tfm .tedt .bar { display: flex; align-items: center; height: auto; padding: 2px 4px; background: none; }
.bar > .fpd { display: flex; align-items: center; gap: 2px; float: none; margin: 0; padding: 0; background: none; }
.pmfm .tedt .area, .tfm .tedt .area { margin: 0; padding: 0; background: none; }
.pmfm .tedt textarea.pt, .tfm .tedt textarea.pt { display: block; width: 100%; height: 76px; box-sizing: border-box; margin: 0; border: 0; border-radius: 0 0 var(--r-md) var(--r-md); background: none; box-shadow: none; outline: none; font: 14px/1.6 var(--font); resize: none; }
/* 设置区表单（发短消息等）里的编辑框比私信对话框的快速回复高，可拖高 */
.tfm .tedt textarea.pt { height: 140px; resize: vertical; }
.pmfm .pns { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pmfm .pns .pn { order: 2; float: none; margin: 0 0 0 auto; }
.pma { margin: 0; }
.pma a { display: inline-flex; align-items: center; gap: 4px; height: 30px; margin: 0; padding: 0 8px; border-radius: var(--r-sm); color: var(--text-3); font-size: 13px; }
.pma a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
/* 原版刷新图标是 pm-ico5.png 位图，夜间看不清，换成跟编辑器工具栏一样的线性图标 */
.pma a img { display: none; }
.pma a::before { content: ""; width: 15px; height: 15px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 12a9 9 0 1 0 3-6.7L3 8%22/%3E%3Cpath d=%22M3 3v5h5%22/%3E%3C/svg%3E") center / 15px 15px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 12a9 9 0 1 0 3-6.7L3 8%22/%3E%3Cpath d=%22M3 3v5h5%22/%3E%3C/svg%3E") center / 15px 15px no-repeat; }

/* ========== Discuz 背景位图图标 → 线性图标 ==========
 * common.css 等原生样式表里有一批 gif/png 背景小图标（下拉箭头、提示、折叠、预览、拖动、进度条……），
 * 不跟主题、夜间看不清，跟侧栏、按钮上的线性图标也不是一套。这里统一撤掉背景图，用 mask 画 currentColor 的线性图标，
 * 图形取自 icons.svg 的同名 symbol。只能按图片背景挂的类名逐个对上，新发现的照这个格式往下加。 */
:root {
	--ic-chev: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m6 9 6 6 6-6%22/%3E%3C/svg%3E");
	--ic-info: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%228.5%22/%3E%3Cpath d=%22M12 11.2v4.6M12 8.2v.3%22/%3E%3C/svg%3E");
	--ic-eye: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z%22/%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223%22/%3E%3C/svg%3E");
	--ic-grip: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01%22/%3E%3C/svg%3E");
	--ic-refresh: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 12a9 9 0 1 0 3-6.7L3 8%22/%3E%3Cpath d=%22M3 3v5h5%22/%3E%3C/svg%3E");
	--ic-check: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m5 12 5 5 9-10%22/%3E%3C/svg%3E");
	--ic-x: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6 6l12 12M18 6 6 18%22/%3E%3C/svg%3E");
	--ic-star: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m12 4 2.4 5 5.6.6-4.2 3.8 1.2 5.5L12 16l-5 2.9 1.2-5.5L4 9.6 9.6 9Z%22/%3E%3C/svg%3E");
	--ic-search: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2211%22 cy=%2211%22 r=%227%22/%3E%3Cpath d=%22m20 20-3.5-3.5%22/%3E%3C/svg%3E");
}
/* 下拉箭头 arrwd.gif：用户组页签、发消息的「选择好友」、会员列表表头 */
.showmenu { background-image: none; padding-right: 0; }
.showmenu::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 3px; vertical-align: -1px; background: currentColor; -webkit-mask: var(--ic-chev) center / 12px no-repeat; mask: var(--ic-chev) center / 12px no-repeat; }
/* 提示 notice.gif：签到页、统计页、用户组页的说明文字 */
.notice { background-image: none; padding-left: 5px; }
.notice::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; background: currentColor; -webkit-mask: var(--ic-info) center / 14px no-repeat; mask: var(--ic-info) center / 14px no-repeat; opacity: .7; }
/* 可折叠小标题 arrow.gif：站点统计「管理团队」 */
.umh h3 { padding-right: 18px; background: none; position: relative; }
.umh h3::after { content: ""; position: absolute; right: 0; top: 50%; width: 12px; height: 12px; margin-top: -6px; background: currentColor; -webkit-mask: var(--ic-chev) center / 12px no-repeat; mask: var(--ic-chev) center / 12px no-repeat; opacity: .6; transition: transform var(--dur-1) var(--ease-io); }
.umh.umn h3::after { transform: rotate(-90deg); }
/* 收起状态 .umn 还铺了一条 dash.gif 虚线，标题和「展开」按钮是写死的白底 */
.umn, .umn .umh_cb { background: none; }
/* 主题预览 preview.png（列表行悬停出现）、版块页「有新回复」刷新 refresh.png */
a.tdpre { width: 22px; height: 22px; margin: 0; padding: 0; border-radius: 6px; background: none; text-indent: 0; font-size: 0; display: inline-grid; place-items: center; color: var(--text-3); }
a.tdpre::before { content: ""; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--ic-eye) center / 15px no-repeat; mask: var(--ic-eye) center / 15px no-repeat; }
a.tdpre:hover { background: var(--line); color: var(--text); }
a.forumrefresh { height: auto; padding-right: 0; background: none; }
a.forumrefresh::after { content: ""; display: inline-block; width: 13px; height: 13px; margin-left: 4px; vertical-align: -2px; background: currentColor; -webkit-mask: var(--ic-refresh) center / 13px no-repeat; mask: var(--ic-refresh) center / 13px no-repeat; }
/* 拖动把手 drag.gif：勋章排序（klpbbs_medal_order）等可拖动列表 */
.drag-trigger { width: 16px; height: 16px; background: currentColor; color: var(--text-3); vertical-align: middle; -webkit-mask: var(--ic-grip) center / 16px no-repeat; mask: var(--ic-grip) center / 16px no-repeat; }
/* 进度条 pllb.png：任务进度、投票结果。柱子颜色投票是行内 background-color 给的，这里只换底槽和形状 */
.pbg { height: 8px; overflow: hidden; border-radius: 999px; background: var(--line); }
.pbr { height: 100%; max-width: 100%; border-radius: inherit; background-image: none; background-color: var(--brand); }
/* 查找好友页标题前的放大镜 scf.gif */
.scf h2 { padding-left: 0; background: none; }
.scf h2::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -2px; background: currentColor; -webkit-mask: var(--ic-search) center / 16px no-repeat; mask: var(--ic-search) center / 16px no-repeat; }
/* 模板里直接写死的 <img> 小图标（用户组权限表的勾叉、星级，密码页的邮箱已验证）：
 * 位图用 object-position 挪出框外看不见，元素本身铺状态色、再用 mask 抠出线性图形。这样不用为一个图标抄整份模板 */
img[src$="/data_valid.gif"], img[src$="/data_invalid.gif"], img[src$="/mail_active.png"], img[src*="/star_level"] { box-sizing: border-box; width: 16px; height: 16px; object-position: 100vw 0; vertical-align: -3px; -webkit-mask: center / 16px no-repeat; mask: center / 16px no-repeat; }
img[src$="/data_valid.gif"], img[src$="/mail_active.png"] { background: var(--ok); -webkit-mask-image: var(--ic-check); mask-image: var(--ic-check); }
img[src$="/data_invalid.gif"] { background: var(--text-3); -webkit-mask-image: var(--ic-x); mask-image: var(--ic-x); }
img[src*="/star_level"] { width: 14px; height: 14px; background: var(--warn); -webkit-mask-image: var(--ic-star); mask-image: var(--ic-star); -webkit-mask-size: 14px; mask-size: 14px; }
/* 折叠箭头 collapsed_no / collapsed_yes.gif（子版块等）：toggle_collapse() 来回换图片地址，按地址决定朝向 */
img[src*="/collapsed_"] { box-sizing: border-box; width: 16px; height: 16px; object-position: 100vw 0; vertical-align: -3px; cursor: pointer; background: var(--text-3); -webkit-mask: var(--ic-chev) center / 16px no-repeat; mask: var(--ic-chev) center / 16px no-repeat; transition: transform var(--dur-1) var(--ease-io); }
img[src*="/collapsed_no"] { transform: rotate(180deg); }
/* 收听状态 flw_statusico.png 只是个装饰小点，去掉 */
[class*="flw_status_"] { padding-left: 0; background: none; }
/* 邀请好友弹窗的页签 thead.png 雪碧图 */
.usd .tbx span { background: none; border-radius: var(--r-sm); }
.usd .tbx span.a { background: var(--hover); color: var(--text); }

/*
 * 只放必须压过 Discuz「!important」的规则。
 * Discuz 的样式在 dz 级联层里，层里的 !important 比层外的还优先，只有排在它前面的 klp-fix 层压得住
 * （层顺序在插件 api/core.php 的 klp_dzcss() 里声明）。普通规则不要往这里放，放这里反而会输给 dz。
 */
@layer klp-fix {
	/* showDialog / showMenu({cover: 1}) 自带的遮罩：颜色和透明度写在行内，只能用 !important 压；由 .klp-veil 代替 */
	#append_parent > div[id$="_cover"] { display: none !important; }
	/* Discuz 写死了白字，夜间模式下主按钮底色是浅色 */
	.pnc, a.pnc { color: var(--bg) !important; }
	/* Discuz 给 .tedt .pt 清了内边距（!important），快速回帖和楼中楼编辑器的文本框因此贴边 */
	#fastposteditor .tedt textarea.pt { padding: 10px 12px !important; }
	.replyfloor_editor .tedt textarea.pt { padding: 10px 12px 4px !important; }
	.pmfm .tedt textarea.pt, .tfm .tedt textarea.pt { padding: 10px 12px !important; }
	/* 版务「高亮」里的取色块：common.css 用 !important 钉死了 23px 宽和一张 pn_color.png（绝对 URL，取不到），
	 * 模板给色块写的行内样式又是 `background-:`（Discuz 自己少写了 color），于是永远是个空白小方块。
	 * 文字色那个（a）换成调色板渐变；背景色那个（input）留白底，选过色之后行内的 background-color 会盖上来 */
	.tm_c .colorwd { box-sizing: border-box; width: 32px !important; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background-color: var(--surface); background-image: none !important; }
	.tm_c a.colorwd { background-image: linear-gradient(135deg, #E5484D, #F5A524 35%, #30A46C 65%, #3E63DD) !important; }
	.tm_c .colorwd:hover { border-color: var(--text-3); }
	/* 表情层原版内边距是 10px 5px 5px（!important），左右太窄，分类标签和表情贴着边 */
	.sllt { padding: 12px !important; }
	/* 道具使用弹窗里 magicshowsetting 输出的 input.px.p_fre：原版 .p_fre 是 width: auto !important，框只有 size="12" 那么宽 */
	.klp-bw-show input.p_fre { width: 100% !important; }
	/* 快速回复的上传按钮：webuploader 把透明的 file input 盖在一个行内写死 17×25 的 div 里，按钮放大到 32px 后只有左上角点得动 */
	#fastposteditor #spanButtonPlaceholder > div[id^="rt_"] { width: 100% !important; height: 100% !important; }
	/* 上传中卡片的「取消」是 Discuz 的雪碧图小叉，显隐由脚本写行内 display；卡片里放不下，统一不显示 */
	#f_pst .upfl .progressCancel { display: none !important; }
	/* 快速发帖选项胶囊：nimba_romotepic 外面套的 .mtm 是 margin-top: 10px !important，胶囊会比同排的低半截；
	 * zzbuluo_replyemail 的「点击设置邮箱」行内写死了 #369 */
	#f_pst .pnpost > .mtm { margin-top: 0 !important; }
	#f_pst .pnpost > label a[style] { color: var(--ink) !important; }
	/* 发帖页同一批插件选项（forum/post 的 .klp-post-hooks）：外层的 .mtm / .mbn 外边距会让两项错开半行 */
	.klp-post-hooks > .mtm, .klp-post-hooks > .mbn { margin: 0 !important; }
	.klp-post-hooks label a[style] { color: var(--ink) !important; }
	/* QQ 互联页的两个页签（qqconnect 插件）：文字色写在行内、切换时脚本再改成 grey / black，夜间模式下黑字看不见 */
	.pg_connect .loggingbox .tb a { color: var(--text-3) !important; }
	.pg_connect .loggingbox .tb .a a, .pg_connect .loggingbox .tb a:hover { color: var(--text) !important; }
}

/* 加载图标：站点把 loading.gif / uploading.gif 换成了像素草方块，这里统一替换成转圈图标。
   Discuz 的脚本和原生模板到处直接写 {IMGDIR}/loading.gif，只能按图片地址整体换；原图文件不动。 */
img[src$="/loading.gif"], img[src$="/uploading.gif"] { content: url("spinner.svg"); width: 16px; height: 16px; vertical-align: -3px; }
#ajaxwaitid { position: fixed; top: calc(var(--top-h) + 10px); right: auto; left: 50%; transform: translateX(-50%); z-index: 400; padding: 6px 12px; border-radius: 999px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-pop); font-size: 12.5px; width: max-content; white-space: nowrap; }
#ajaxwaitid span { display: inline-flex; align-items: center; gap: 6px; }
