/* 页面级样式：帖子页（对照设计稿 Thread.dc.html） */

/* 版心：主栏随屏宽伸缩 + 右栏 320（设计稿 1440 画板上主栏正好 720）；面包屑在两栏上方，左右卡片顶部对齐 */

/* ---------- 主楼卡片：标签 → 标题 → 作者行 → 正文 → 操作栏 ---------- */
.klp-postlist { display: flex; flex-direction: column; gap: 16px; background: none; border: 0; margin: 0; overflow: visible; }
.klp-thread { padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; }
.klp-thread-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.klp-thread-tags:empty { display: none; }
.klp-thread-title { margin: 0; font-size: 26px; line-height: 1.4; font-weight: 600; letter-spacing: -.005em; word-break: break-word; }
.klp-thread-title > a { color: inherit; }
.klp-thread-title > a:hover { color: var(--ink); }
.klp-thread-author { display: flex; align-items: center; gap: 12px; }
.klp-ta-av { position: relative; flex: none; }
.klp-thread-author:has(> .klp-ta-av > .k-av > .k-av-frame) { gap: 17px; }
.klp-ta-av > .klp-usercard { top: 48px; left: 0; }
.klp-ta-who { display: flex; flex-direction: column; gap: 3px; line-height: 1.4; min-width: 0; }
.klp-ta-name { display: flex; align-items: center; gap: 6px; }
.klp-ta-name > a { font-weight: 600; }
.klp-ta-who .k-meta { font-size: 12.5px; }
.klp-vstat { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 13px; }
.k-av-40 { width: 40px; height: 40px; }
.klp-hookrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--text-3); }
.klp-hookrow:empty { display: none; }
/* 版主操作：虚线描边的一条工具带，前面挂「管理」标签，链接做成小按钮 */
.klp-thread-mod { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 5px 6px; border: 1px dashed var(--line); border-radius: 12px; font-size: 12.5px; }
.klp-thread-mod .pipe { display: none; }
.klp-mod-lbl { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 6px; margin-right: 4px; border-right: 1px solid var(--line); color: var(--text-3); font-weight: 500; }
.klp-thread-mod a { display: inline-flex; align-items: center; height: 26px; padding: 0 8px; border-radius: 7px; color: var(--text-2); }
.klp-thread-mod a:hover { background: var(--hover); color: var(--text); }
.klp-thread-mod a[onclick*="delete"] { color: var(--danger); }
.klp-thread-mod a[onclick*="delete"]:hover { background: var(--danger-soft); }
/* 作者行时间后面的插件输出（编辑、IP 等），跟在同一行 */
.klp-ta-hooks { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.klp-ta-hooks:empty { display: none; }

/* 「本帖最后由 … 编辑」 */
.klp-first-body .pstatus, .klp-floor-body .pstatus { display: inline-flex; align-items: center; margin-bottom: 12px; padding: 0 10px; height: 24px; border-radius: 999px; background: var(--hover); color: var(--text-3); font-size: 12px; font-style: normal; }
/* 回帖奖励 / 抢楼：暖色提示卡，左图标、中说明、右侧奖池数字 */
.klp-bonus { display: flex; flex-direction: column; border: 1px solid var(--warn-line); border-radius: var(--r-lg); background: var(--warn-soft); color: var(--warn); overflow: hidden; }
.klp-bonus-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.klp-bonus-row + .klp-bonus-row { border-top: 1px dashed var(--warn-line); }
.klp-bonus-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface); border: 1px solid var(--warn-line); }
.klp-bonus-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.klp-bonus-t { font-size: 14.5px; font-weight: 600; color: var(--text); }
.klp-bonus-t b { color: var(--warn); font-size: 16px; white-space: nowrap; }
.klp-bonus-d { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-3); }
.klp-bonus-pool { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding-left: 18px; border-left: 1px dashed var(--warn-line); }
.klp-bonus-pool b { font-size: 22px; line-height: 1.1; }
.klp-bonus-pool span { font-size: 12px; color: var(--text-3); }
.klp-bonus-act { flex: none; display: flex; gap: 6px; }
.klp-post-first { background: none; border: 0; }
.klp-first-body { display: flex; flex-direction: column; gap: 16px; }
#threadstamp { position: absolute; right: 24px; top: -8px; pointer-events: none; }
.klp-thread { position: relative; }

/* 正文排版：16px / 1.85，段落、引用、代码、表格统一 */
.klp-post .t_f { font-size: 15px; line-height: 1.75; color: var(--text); word-break: break-word; }
.klp-post-first .t_f { font-size: 16px; line-height: 1.85; }
.klp-post .t_f img { max-width: 100%; height: auto; border-radius: 12px; }
.klp-post .t_f a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.klp-post .t_f table { border-collapse: collapse; }
.klp-post .t_f td { border-color: var(--line); }
.klp-post .t_f h1, .klp-post .t_f h2, .klp-post .t_f h3 { font-size: 18px; margin: 8px 0 0; }
.klp-post .t_f blockquote, .klp-post .quote { margin: 8px 0; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--hover); color: var(--text-2); font-size: 14.5px; }
.klp-post .quote blockquote { margin: 0; padding: 0; background: none; }
.klp-post .blockcode { border-radius: 12px; }
.klp-post .pct { padding: 0; }
.klp-post .pcb { margin-right: 0; }
.klp-post .t_fsz { min-height: 0; }
.klp-post .t_f > table, .klp-post .pcb > table { width: 100%; }

/* 帖子背景（[postbg]）：纹理只铺正文区，收成一张圆角「信纸」，不再压住分类信息、AI 速览和作者行（klp_post_bg()）。
   纹理是十几张浅色平铺小图，上面叠一层半透明底色压对比；夜间压得更深，否则浅纹理会吃掉浅色字 */
.klp-pbg { --klp-pbg-veil: color-mix(in srgb, var(--surface) 30%, transparent); padding: 22px 26px; border-radius: var(--r-lg); background: linear-gradient(var(--klp-pbg-veil), var(--klp-pbg-veil)), var(--klp-pbg) repeat; box-shadow: inset 0 0 0 1px var(--line); }
html[data-theme="dark"] .klp-pbg { --klp-pbg-veil: color-mix(in srgb, var(--surface) 90%, transparent); }
.klp-floor-body .klp-pbg { padding: 16px 20px; }

/* 分类信息（主题分类的字段表）：标题行 + 键值两列，键固定宽度，长链接允许断行 */
.klp-post .typeoption { margin: 0 0 16px; }
.klp-post .typeoption .cgtl { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); font-size: 14px; }
.klp-post .typeoption .cgtl caption { caption-side: top; text-align: left; padding: 0 2px 8px; background: none; border: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.klp-post .typeoption .cgtl caption::before { content: ""; display: inline-block; width: 3px; height: 14px; margin-right: 8px; border-radius: 2px; background: var(--brand); vertical-align: -2px; }
.klp-post .typeoption .cgtl th, .klp-post .typeoption .cgtl td { padding: 10px 16px; border: 0; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.6; background: none; }
.klp-post .typeoption .cgtl tr:first-child th, .klp-post .typeoption .cgtl tr:first-child td { border-top: 0; }
/* overflow: hidden 裁不了表格的单元格背景（overflow 不作用于 table box），
   四角的圆角得落到角上的单元格自己身上，否则左列灰底会方角戳出圆角外 */
.klp-post .typeoption .cgtl tr:first-child th { border-top-left-radius: var(--r-lg); }
.klp-post .typeoption .cgtl tr:first-child td { border-top-right-radius: var(--r-lg); }
.klp-post .typeoption .cgtl tr:last-child th { border-bottom-left-radius: var(--r-lg); }
.klp-post .typeoption .cgtl tr:last-child td { border-bottom-right-radius: var(--r-lg); }
.klp-post .typeoption .cgtl th { width: 112px; white-space: nowrap; color: var(--text-3); font-weight: 500; background: var(--hover); }
.klp-post .typeoption .cgtl td { color: var(--text); word-break: break-all; }
.klp-post .typeoption .cgtl td a { color: var(--ink); }
.klp-post .typeoption .cgtl tr:hover td { background: color-mix(in srgb, var(--hover) 50%, transparent); }

/* 标签 */
.klp-post .ptg { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; background: none; padding: 0; }
.klp-post .ptg a { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--text-2); }
.klp-post .ptg a::before { content: "#"; color: var(--text-3); margin-right: 3px; }
.klp-post .ptg a:hover { background: var(--hover); color: var(--text); }
.klp-post .ptg img, .klp-post .ptg .pipe { display: none; }
.klp-post .modact { font-size: 12px; color: var(--text-3); margin-top: 8px; }

/* 附件：图标 + 文件名 / 大小 + 下载按钮 */
.klp-post .pattl { margin-top: 4px; display: flex; flex-direction: column; gap: 10px; }
.klp-post .tattl { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 0; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); margin: 0; box-sizing: border-box; }
.klp-post .tattl dt { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--hover); display: grid; place-items: center; }
.klp-post .tattl dt img { width: 26px; height: 26px; }
.klp-post .tattl dd { margin: 0; flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-3); font-family: var(--mono); }
.klp-post .tattl dd p { margin: 0; }
.klp-post .tattl dd p a, .klp-post .tattl dd a strong { color: var(--text); font: 600 14px var(--font); }
/* 图片附件（未插入正文的）同样是 dl.tattl，但带 .attm、dt 为空：改竖排，去掉图标框，图片按栏宽缩放（Discuz 输出了 width="600"） */
.klp-post .tattl.attm { display: block; padding: 12px; }
.klp-post .tattl.attm dt { display: none; }
.klp-post .tattl.attm .savephotop { margin: 10px 0 0; }
.klp-post .tattl.attm .savephotop img { display: block; max-width: 100%; height: auto; border-radius: var(--r-md); cursor: zoom-in; }
.klp-post .attach_nopermission { border-radius: 12px; border: 0; background: var(--warn-soft); color: var(--warn); padding: 12px 16px; }
.klp-post .attach_nopermission img, .klp-post .attach_nopermission .atips_close { display: none; }

/* 评分 / 点评 */
.klp-post .cm { margin-top: 12px; }
.klp-post .psth { font-size: 13px; font-weight: 600; background: none; padding: 0 0 8px; border-bottom: 1px solid var(--line); margin: 0 0 8px; }
.klp-post .psth .icon_ring { display: none; }
/* 评分：标题行（人数 + 各积分合计）+ 每人一行；楼中楼插件在它上面 */
.klp-rate { margin-top: 14px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.klp-rate-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; font-size: 13px; }
.klp-rate-t { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--text); }
.klp-rate-t svg { color: var(--warn); }
.klp-rate-num { color: var(--text-3); font-size: 12.5px; }
.klp-rate-num b { color: var(--text); font-weight: 600; margin-right: 2px; }
.klp-rate-num:hover, .klp-rate-num:hover b { color: var(--ink); }
.klp-rate-h .k-chip b { font-weight: 600; }
.klp-rate-op { font-size: 12.5px; color: var(--text-3); }
.klp-rate-op:hover { color: var(--ink); }
.klp-post .rate { border: 0; margin: 0; padding: 0; }
.klp-post .rate dd { margin: 0; padding: 0; }
.klp-post .rate_collapse .klp-rate-list, .klp-post .rate_collapse .klp-rate-avs { display: none; }
.klp-rate-list { list-style: none; margin: 0; padding: 4px 0; border-top: 1px solid var(--line); background: var(--bg); }
.klp-rate-list li { float: none; width: auto; height: auto; margin: 0; text-align: left; display: grid; grid-template-columns: 22px minmax(0, 140px) auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 14px; font-size: 13px; }
.klp-rate-list li:hover { background: var(--hover); }
.klp-rate-name { color: var(--text); font-weight: 500; }
.klp-rate-score { display: inline-flex; gap: 8px; white-space: nowrap; }
.klp-rate-score em { font-style: normal; font-size: 12.5px; color: var(--text-3); }
.klp-rate-score .is-up b { color: var(--ok); font-weight: 600; }
.klp-rate-score .is-down b { color: var(--danger); font-weight: 600; }
.klp-rate-why { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.klp-rate-avs li { float: none; width: auto; height: auto; margin: 0; }
.klp-rate-avs { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bg); }
.klp-post .pstl { padding: 8px 0; border-bottom: 1px solid var(--line); }
.klp-post .sign { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--text-3); background: none; overflow: hidden; }
/* 同时限宽限高时写死的 width 属性会把图压扁 */
.klp-post .sign img { max-height: 90px; object-fit: contain; object-position: left center; }
.klp-first-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.klp-first-extra b { font-weight: 600; margin-right: 4px; }

/* 主楼操作栏：支持 / 评分 / 收藏 / 分享 …… 回复 / 编辑 / 更多 */
.klp-actbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); margin: 0; text-align: left; }
.klp-actbar .k-btn { height: 36px; }
.klp-actbar .klp-cnt { color: var(--text-3); font-weight: 500; }
.klp-actbar .klp-cnt:empty { display: none; }
.klp-actbar .klp-more { width: 36px; padding: 0; }
.klp-actbar a i { font-style: normal; }
.klp-actbar a img { width: 16px; height: 16px; }

/* 下拉菜单（分享、更多）：沿用 Discuz 的 showMenu，外观走 .p_pop */
.klp-popmenu { min-width: 180px; display: flex; flex-direction: column; }
.klp-popmenu a { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; }
/* 「更多」菜单里的推送、点评、分享沿用原版类名（.push / .cmmnt / .sharep……），原版给它们画了背景位图图标，会压在文字上，去掉。
   只管菜单自己的项（直接子元素）：插件经 viewthread_share_method 塞进来的分享按钮可能就是靠背景图画图标的 */
.klp-popmenu > a { background-image: none; }
.klp-popmenu a:hover { background: var(--hover); color: var(--text); }
.klp-popmenu a.klp-danger { color: var(--danger); }
.klp-popmenu-sep { height: 1px; margin: 4px 6px; background: var(--line); }
/* 分组小标题（空间页「更多」里的用户管理 / 内容管理）。原版这两项是各自悬停弹二级菜单，
 * 但 showMenu 弹新菜单前会先收起同一层的所有菜单，套在下拉里一悬停就把外层「更多」关了，所以拍平成分组。
 * 看自己的空间时没有「加为好友」，分组打头的分隔线就不要了 */
.klp-popmenu-t { padding: 6px 10px 4px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.klp-popmenu-sep:first-child { display: none; }
.klp-share-method { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 6px; font-size: 13px; }
.klp-share-method a { height: 30px; }

/* ---------- 回复区 ---------- */
/* 从提醒、「回复了你」跳到某一楼（#pid回帖 / #lastpost）：顶栏是吸顶的，滚过去后楼层顶部会被它盖住 */
[id^="pid"], #lastpost { scroll-margin-top: calc(var(--top-h) + 16px); }
.klp-replies-h { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.klp-replies-t { font-size: 17px; font-weight: 600; margin-right: 8px; }
.klp-replies-t .k-mono { color: var(--text-3); font-weight: 400; }
.klp-jump { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.klp-jump .k-inp { width: 56px; height: 30px; padding: 0 8px; font-family: var(--mono); font-size: 13px; }
.klp-post { background: none; border: 0; }

/* 每层一张卡片 */
.klp-floor { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 12px; display: flex; flex-direction: column; gap: 12px; }
.klp-floor.is-stick { box-shadow: inset 3px 0 0 var(--brand); }
.klp-floor.is-deleted { padding-bottom: 18px; }
.klp-floor-h { display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; }
.klp-favatar { position: relative; width: auto; flex: none; }
.klp-favatar .avatar, .klp-favatar .avtm { margin: 0; padding: 0; background: none; }
.klp-favatar img { width: 32px; height: 32px; border-radius: 50%; padding: 0; border: 0; background: none; display: block; }
.k-av-32 { width: 32px; height: 32px; }
.klp-floor-who { display: flex; flex-direction: column; gap: 3px; line-height: 1.4; min-width: 0; flex: 1; }
.klp-floor-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.klp-author { font-weight: 600; font-size: 13.5px; color: var(--text); }
.klp-author:hover { color: var(--ink); }
.klp-floor-name .k-chip-sm { height: 18px; padding: 0 6px; font-size: 11px; }
.klp-floor-name .klp-grouptitle { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.klp-floor-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text-3); }
.klp-floor-meta em { font-style: normal; }
.klp-floor-meta .k-ic { vertical-align: -2px; }
.klp-floor-hook:empty { display: none; }
.klp-floor-hook { display: inline-flex; align-items: center; gap: 6px; }
.klp-floor-badges { display: flex; gap: 4px; }
.klp-floor-badges:empty { display: none; }
.klp-floor-no { flex: none; margin-left: auto; font: 500 12px var(--mono); color: var(--text-3); }
.klp-floor-no:hover { color: var(--text); }
.klp-floor-body { margin-left: 42px; min-width: 0; }
.klp-floor-body .t_f { font-size: 15px; line-height: 1.75; }
.klp-replycredit { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; padding: 2px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; }

/* 楼层操作：支持 / 回复 / 点评 …… 举报 / 更多 */
.klp-floor-f { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin-left: 32px; padding: 0; border: 0; background: none; }
.klp-act { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; color: var(--text-3); font-size: 13px; background: none; }
.klp-act:hover { background: var(--hover); color: var(--text); }
.klp-act .k-mono { font-size: 12px; }
.klp-act .k-mono:empty { display: none; }
.klp-act-ic { width: 32px; padding: 0; justify-content: center; }
.klp-act-dan:hover { background: var(--danger-soft); color: var(--danger); }
.klp-manage { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-size: 12.5px; color: var(--text-3); }
.klp-floor-f .klp-floor-hook a { display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 8px; color: var(--text-3); font-size: 13px; }
.klp-floor-f .klp-floor-hook a:hover { background: var(--hover); color: var(--text); }
.klp-floor:not(:hover) .klp-floor-f .klp-act-ic { opacity: .6; }
.klp-debate-filter { align-self: flex-start; }

/* 翻页栏 */
.pg_viewthread .klp-pagebar { justify-content: center; }

/* 快速回复（Discuz 默认模板，只改外观）：头像 + 输入框，输入框下面一排图标工具，最后一行是选项和发表按钮。
   工具按钮原本是雪碧图，这里用和站内一致的线性图标（mask 画在 ::before 上，颜色跟随文字）。 */
#f_pst.bm { padding: 16px 18px; margin: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: visible; }
#f_pst > form > table, #f_pst > form > table > tbody { display: block; width: 100%; }
#f_pst > form > table > tbody > tr { display: flex; gap: 12px; align-items: flex-start; }
#f_pst td.pls { display: block; flex: none; width: 34px; padding: 0; border: 0; background: none; }
#f_pst td.pls .avatar { margin: 0; padding: 0; background: none; }
#f_pst td.pls .avatar img { width: 34px; height: 34px; border-radius: 50%; padding: 0; border: 0; }
#f_pst td.plc { display: block; flex: 1; min-width: 0; padding: 0; border: 0; font-size: 13px; color: var(--text-3); }
#f_pst td.plc > * + * { margin-top: 10px; }
#f_pst #s1 { width: auto !important; max-width: 100%; height: 30px; margin-left: 4px; }
#fastsmiliesdiv { display: none; }
#fastposteditor, #fastposteditor.hasfsl { margin: 0; padding: 0; }
#fastposteditor .tedt { display: flex; flex-direction: column; margin: 0; border: 0; background: none; overflow: visible; }
#fastposteditor .area { order: -1; padding: 0; border: 0; background: none; }
#fastposteditor .area .pt, #fastpostmessage { width: 100%; min-height: 96px; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: 14px/1.7 var(--font); resize: vertical; }
#fastposteditor .area div.pt { min-height: 0; padding: 16px; line-height: 1.7; text-align: center; color: var(--text-3); }
#fastposteditor .bar { order: 1; display: flex; align-items: center; height: auto; margin: 0; padding: 6px 0 0; border: 0; background: none; }
#fastposteditor .bar .fpd { display: flex; align-items: center; gap: 2px; float: none; margin: 0; padding: 0; background: none; }
/* 用 flex 不用 grid：按钮里还有「B」「Color」这些字（字号压成 0），grid 下它们自成一行、平分掉空余高度，
   图标就比没有文字的上传按钮（图片、回形针）高出 3～4px，一排高低不齐 */
#fastposteditor .bar .fpd a, .replyfloor_editor .bar .fpd a, .bar > .fpd a { position: relative; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0; line-height: 0; color: var(--text-3); background: none; text-indent: 0; overflow: hidden; }
#fastposteditor .bar .fpd a:hover, .replyfloor_editor .bar .fpd a:hover, .bar > .fpd a:hover { background: var(--hover); color: var(--text); }
#fastposteditor .bar .fpd a::before, .replyfloor_editor .bar .fpd a::before, .bar > .fpd a::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: center / 18px 18px no-repeat; mask: center / 18px 18px no-repeat; }
#fastposteditor .bar .fpd a .webuploader-pick, .replyfloor_editor .bar .fpd a .webuploader-pick { position: absolute; inset: 0; font-size: 0; background: none; }
#fastposteditor .bar .y { order: 2; float: none; margin-left: auto; display: flex; align-items: center; gap: 4px; }
#fastposteditor .bar .y a { display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 8px; color: var(--text-3); font-size: 13px; background: none; }
#fastposteditor .bar .y a:hover { background: var(--hover); color: var(--text); }
#fastposteditor .bar .pipe { display: none; }
#fastposteditor #spanButtonPlaceholder { font-size: 13px; color: var(--text-3); }
#fastposteditor .bar .fpd a.fbld::before, .replyfloor_editor .bar .fpd a.fbld::before, .bar > .fpd a.fbld::before { -webkit-mask-image: 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=%22M7 5h6a3.5 3.5 0 0 1 0 7H7zM7 12h7a3.5 3.5 0 0 1 0 7H7z%22/%3E%3C/svg%3E"); mask-image: 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=%22M7 5h6a3.5 3.5 0 0 1 0 7H7zM7 12h7a3.5 3.5 0 0 1 0 7H7z%22/%3E%3C/svg%3E"); }
#fastposteditor .bar .fpd a.fclr::before, .replyfloor_editor .bar .fpd a.fclr::before, .bar > .fpd a.fclr::before { -webkit-mask-image: 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 3a9 9 0 1 0 0 18c1 0 1.6-.8 1.6-1.6 0-1.3 1-2.4 2.4-2.4H18a3 3 0 0 0 3-3c0-5-4-9-9-9Z%22/%3E%3Ccircle cx=%227.5%22 cy=%2211%22 r=%221%22/%3E%3Ccircle cx=%2210.5%22 cy=%227.5%22 r=%221%22/%3E%3Ccircle cx=%2215%22 cy=%228%22 r=%221%22/%3E%3C/svg%3E"); mask-image: 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 3a9 9 0 1 0 0 18c1 0 1.6-.8 1.6-1.6 0-1.3 1-2.4 2.4-2.4H18a3 3 0 0 0 3-3c0-5-4-9-9-9Z%22/%3E%3Ccircle cx=%227.5%22 cy=%2211%22 r=%221%22/%3E%3Ccircle cx=%2210.5%22 cy=%227.5%22 r=%221%22/%3E%3Ccircle cx=%2215%22 cy=%228%22 r=%221%22/%3E%3C/svg%3E"); }
#fastposteditor .bar .fpd a.fmg::before, .replyfloor_editor .bar .fpd a.fmg::before, .bar > .fpd a.fmg::before { -webkit-mask-image: 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%3Crect x=%224%22 y=%225%22 width=%2216%22 height=%2214%22 rx=%222%22/%3E%3Ccircle cx=%229%22 cy=%2210%22 r=%221.5%22/%3E%3Cpath d=%22m20 16-5-5-8 8%22/%3E%3C/svg%3E"); mask-image: 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%3Crect x=%224%22 y=%225%22 width=%2216%22 height=%2214%22 rx=%222%22/%3E%3Ccircle cx=%229%22 cy=%2210%22 r=%221.5%22/%3E%3Cpath d=%22m20 16-5-5-8 8%22/%3E%3C/svg%3E"); }
#fastposteditor .bar .fpd a.flnk::before, .bar > .fpd a.flnk::before { -webkit-mask-image: 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=%22M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1%22/%3E%3C/svg%3E"); mask-image: 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=%22M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1%22/%3E%3C/svg%3E"); }
#fastposteditor .bar .fpd a.fqt::before, .bar > .fpd a.fqt::before { -webkit-mask-image: 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 17c2 0 4-2 4-5V7H5v5h5M15 17c2 0 4-2 4-5V7h-5v5h5%22/%3E%3C/svg%3E"); mask-image: 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 17c2 0 4-2 4-5V7H5v5h5M15 17c2 0 4-2 4-5V7h-5v5h5%22/%3E%3C/svg%3E"); }
#fastposteditor .bar .fpd a.fcd::before, .bar > .fpd a.fcd::before { -webkit-mask-image: 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=%22m9 8-4 4 4 4M15 8l4 4-4 4%22/%3E%3C/svg%3E"); mask-image: 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=%22m9 8-4 4 4 4M15 8l4 4-4 4%22/%3E%3C/svg%3E"); }
#fastposteditor .bar .fpd a.fsml::before, .replyfloor_editor .bar .fpd a.fsml::before, .bar > .fpd a.fsml::before { -webkit-mask-image: 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%22/%3E%3Cpath d=%22M9 14a4 4 0 0 0 6 0M9.5 10h.01M14.5 10h.01%22/%3E%3C/svg%3E"); mask-image: 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%22/%3E%3Cpath d=%22M9 14a4 4 0 0 0 6 0M9.5 10h.01M14.5 10h.01%22/%3E%3C/svg%3E"); }
#fastposteditor .bar .fpd a.fat::before, .bar > .fpd a.fat::before { -webkit-mask-image: 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=%223.5%22/%3E%3Cpath d=%22M15.5 12v1.5a2.5 2.5 0 0 0 5 0V12a8.5 8.5 0 1 0-3.3 6.7%22/%3E%3C/svg%3E"); mask-image: 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=%223.5%22/%3E%3Cpath d=%22M15.5 12v1.5a2.5 2.5 0 0 0 5 0V12a8.5 8.5 0 1 0-3.3 6.7%22/%3E%3C/svg%3E"); }
/* 按钮行：左边一排选项胶囊（回帖后跳到最后一页、转播、nimba_romotepic 的远程图片本地化），右边积分规则 + 快捷键 + 发表。
   原模板这一行是 <p>，插件往钩子里塞的是 <div class="mtm">，浏览器遇到 div 会把 p 提前闭合，
   后面的选项全被甩到按钮行外面各占一行、样式也跟不上；新模板的 forum/*_fastpost.htm 已改成 div。 */
#f_pst .pnpost { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; font-size: 12.5px; color: var(--text-3); }
/* 积分规则 + 快捷键 + 发表按钮包成 .klp-fp-act 一组：选项多了换行时整组一起靠右，不会只剩按钮孤零零掉到下一行左边 */
#f_pst .pnpost .klp-fp-act { order: 99; display: flex; align-items: center; gap: 12px; margin-left: auto; }
#f_pst .pnpost .y { float: none; color: var(--text-3); }
#f_pst .pnpost .y:hover { color: var(--ink); }
#f_pst .pnpost > label, #f_pst .pnpost > .mtm { order: 1; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 30px; margin: 0; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); cursor: pointer; user-select: none; transition: background var(--dur-1) var(--ease-io), border-color var(--dur-1) var(--ease-io), color var(--dur-1) var(--ease-io); }
/* 插件的复选框和 label 是兄弟节点（label for），label 撑满胶囊剩下的部分，点哪都能切换 */
#f_pst .pnpost > .mtm > label { display: flex; align-items: center; align-self: stretch; margin-right: -12px; padding-right: 12px; cursor: pointer; }
#f_pst .pnpost > label:hover, #f_pst .pnpost > .mtm:hover { border-color: color-mix(in srgb, var(--text) 20%, var(--line)); color: var(--text); }
#f_pst .pnpost > label:has(input:checked), #f_pst .pnpost > .mtm:has(input:checked) { border-color: transparent; background: var(--soft); color: var(--soft-ink); }
#f_pst .pnpost > label:has(input:focus-visible), #f_pst .pnpost > .mtm:has(input:focus-visible) { box-shadow: var(--ring); }
#f_pst .pnpost input[type="checkbox"] { flex: none; width: 14px; height: 14px; margin: 0; vertical-align: 0; accent-color: var(--soft-ink); cursor: pointer; }
#f_pst .pnpost > span { order: 2; }
#f_pst .pnpost .klp-fp-act::before { content: "Ctrl + Enter"; order: 1; font: 12px var(--mono); color: var(--text-3); }
#f_pst .pnpost #fastpostsubmit { order: 2; height: 36px; margin: 0; padding: 0 16px; border-radius: 10px; }
#f_pst .pnpost #fastpostsubmit strong { font-weight: 600; }
#f_pst .upfl { margin: 0; }
#fastpostreturn:empty { display: none; }

/* 上传按钮（h5upload 在 #spanButtonPlaceholder 上画的是 17×25 的彩色回形针图，跟左边的线性图标不是一套）：
   换成同样的 32px 图标按钮。插件的样式写在页面里的 <style>，只有一个 id，这里多挂一层 id 压过它 */
#fastposteditor .bar #spanButtonPlaceholder { position: relative; flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; background: none; color: var(--text-3); font-size: 0; cursor: pointer; }
#fastposteditor .bar #spanButtonPlaceholder:hover { background: var(--hover); color: var(--text); }
#fastposteditor .bar #spanButtonPlaceholder::before { content: ""; width: 18px; height: 18px; 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=%22m20 11-8 8a5 5 0 0 1-7-7l8-8a3.5 3.5 0 0 1 5 5l-8 8a2 2 0 0 1-3-3l7-7%22/%3E%3C/svg%3E") center / 18px 18px 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=%22m20 11-8 8a5 5 0 0 1-7-7l8-8a3.5 3.5 0 0 1 5 5l-8 8a2 2 0 0 1-3-3l7-7%22/%3E%3C/svg%3E") center / 18px 18px no-repeat; }
#fastposteditor .bar #spanButtonPlaceholder .webuploader-pick { position: absolute; inset: 0; padding: 0; font-size: 0; text-indent: 0; background: none; }

/* 已上传的图片 / 附件：h5upload 每个文件一张 209px 宽的蓝框小表，图标是 filetype 目录里的小树 gif。
   改成一排圆角小卡片：缩略图（klp.js 的 initUpThumbs 从悬停预览里取图）+ 文件名 + 删除。上传中的进度条画在卡片底边 */
#f_pst #imageattachlist, #f_pst #attachlist { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#f_pst #imageattachlist:empty, #f_pst #attachlist:empty { display: none; }
#f_pst .upfl .progressWrapper { float: none; width: auto; margin: 0; overflow: visible; }
#f_pst .upfl .progressWrapper table { float: none; width: auto; margin: 0; border: 1px solid var(--line); border-radius: 10px; border-collapse: separate; background: var(--surface); transition: border-color var(--dur-1) var(--ease-io); }
#f_pst .upfl .progressWrapper table:hover { border-color: color-mix(in srgb, var(--text) 20%, var(--line)); }
#f_pst .upfl .progressWrapper td { padding: 0; border: 0; border-radius: 0; vertical-align: middle; }
#f_pst .upfl .attswf p { display: flex; align-items: center; width: auto; height: 44px; margin: 0; padding: 0 2px 0 6px; line-height: normal; overflow: visible; }
#f_pst .upfl .attswf p > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
#f_pst .upfl .attswf p > span > a { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-2); }
#f_pst .upfl .attswf p > span > a:hover { color: var(--ink); }
#f_pst .upfl .attswf p > span > img { flex: none; width: 16px; height: 16px; margin: 0 4px; }
#f_pst .upfl .attswf p > span > img.klp-up-thumb { width: 32px; height: 32px; margin: 0; border-radius: 6px; object-fit: cover; background: var(--hover); }
#f_pst .upfl .attswf .atturl { display: none; }
#f_pst .upfl td.attc { width: auto; padding: 0 6px 0 0; }
#f_pst .upfl td.attc a.d { box-sizing: border-box; width: 24px; height: 24px; margin: 0; display: grid; place-items: center; border-radius: 6px; background: none; color: var(--text-3); font-size: 0; text-indent: 0; overflow: hidden; }
#f_pst .upfl td.attc a.d::before { content: "×"; font-size: 17px; line-height: 1; }
#f_pst .upfl td.attc a.d:hover { background: var(--danger-soft); color: var(--danger); }
#f_pst .upfl .progressContainer { position: relative; box-sizing: border-box; display: flex; align-items: center; gap: 10px; min-width: 180px; max-width: 260px; height: 46px; margin: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 12.5px; color: var(--text-3); overflow: hidden; }
#f_pst .upfl .progressName { flex: 0 1 auto; width: auto; min-width: 0; max-width: 180px; height: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
#f_pst .upfl .progressBarStatus { flex: none; margin-left: auto; font-family: var(--mono); }
#f_pst .upfl .progressBarInProgress { position: absolute; left: 0; bottom: 0; height: 2px; margin: 0; background: var(--brand); transition: width var(--dur-2) var(--ease-io); }
#f_pst .upfl .progressBarComplete, #f_pst .upfl .progressBarError { display: none; }
#f_pst .upfl .progressContainer.red { border-color: var(--danger); color: var(--danger); }

/* 版块页「快速发帖」：分类下拉 + 标题一行。原来的分类是 simulateSelect 模拟出来的灰色方块下拉，跟站内控件不是一套，改回原生 select */
#f_pst.bm > .bm_h { min-height: 0; padding: 0 0 12px; line-height: 1.5; border: 0; }
#f_pst.bm > .bm_c { padding: 0; }
.klp-fp-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.klp-fp-type { flex: none; max-width: 200px; }
.klp-fp-subj { position: relative; flex: 1; min-width: 0; }
.klp-fp-subj .px { width: 100%; padding-right: 150px; }
.klp-fp-subj > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-3); pointer-events: none; white-space: nowrap; }
.klp-fp-subj > span strong { font: 600 12px var(--mono); color: var(--text-2); }

/* ---------- 右栏 ---------- */
.klp-authorcard { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; }
.klp-ac-head { display: flex; align-items: center; gap: 12px; }
.klp-ac-head .k-av img { width: 48px; height: 48px; }
.klp-ac-head:has(> .k-av > .k-av-frame) { gap: 20px; }
.klp-ac-name { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.klp-ac-name > a, .klp-ac-name > b { font-weight: 600; }
/* 匿名主题的占位卡：图标压暗一档，别抢真楼主卡片的视觉分量 */
.klp-ac-anon .k-av { color: var(--text-3); }
.klp-ac-tip { margin: 0; font-size: 12.5px; color: var(--text-3); }
.klp-ac-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.klp-ac-stats > * { display: flex; flex-direction: column; }
.klp-ac-stats > * + * { border-left: 1px solid var(--line); }
.klp-ac-stats b { font-size: 17px; font-weight: 500; }
.klp-ac-medals { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.klp-ac-medals img { width: 28px; height: 28px; object-fit: contain; }
.klp-ac-medals .k-meta { margin-left: 4px; font-size: 12px; }
.klp-ac-act { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.klp-ac-plugins { padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); display: flex; flex-direction: column; gap: 6px; }
.klp-ac-plugins img { max-height: 20px; vertical-align: middle; }
.klp-ac-plugins:empty, .klp-ac-plugins:not(:has(> :not(:empty))) { display: none; }
.klp-floornav { padding: 14px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.klp-floornav .k-btn-gho { color: var(--text-3); font-weight: 500; }

/* viewthread_useraction 钩子：有插件的输出以 </div> 开头，提前关掉 #p_btn 再另起一块（帖子永久地址、版权声明），
   所以钩子必须放在 #p_btn 最后；这里把紧跟在操作栏后面的那块收拾成统一的浅色区块 */
#p_btn + div:not([id]):not([class]) { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--text-2); }
#p_btn + div:not([id]):not([class]) > div { margin: 0 !important; padding: 12px 14px !important; border-radius: 12px !important; border: 0 !important; background: var(--hover) !important; color: var(--text-2) !important; text-align: left !important; box-shadow: none !important; }
#p_btn + div:not([id]):not([class]) b { color: var(--text); }
#p_btn + div:not([id]):not([class]) .px { height: 30px; width: min(420px, 60%); font: 12.5px var(--mono); }
#p_btn + div:not([id]):not([class]) button { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; }
.klp-hookrow .pipe { display: none; }
/* 空的 DIY 区块不占位（否则多出一个间距，左右两栏顶部对不齐）；DIY 编辑模式下照常显示 */
body:not(:has(#controlpanel)) .klp-diy:has(> .area:empty) { display: none; }
#p_btn + div:not([id]):not([class]) > br { display: none; }
#p_btn + div:not([id]):not([class]) fieldset { margin: 0; padding: 12px 14px !important; border: 1px solid var(--line) !important; border-radius: 12px !important; font-size: 12.5px; line-height: 1.8; color: var(--text-3); }
#p_btn + div:not([id]):not([class]) fieldset legend { width: auto !important; padding: 0 6px !important; background: none !important; color: var(--text-2) !important; font-weight: 600; font-size: 12.5px; text-align: left !important; }
#p_btn + div:not([id]):not([class]) fieldset font { color: inherit !important; }
/* 插件在作者行 / 楼层头塞的「| 编辑」和 IP 属地（viewthread_postheader）：
 * 竖线换成和时间一致的「·」；右浮动、行内 padding-left:25px 和 .editp 的铅笔背景图都是给旧模板留的，
 * 行内样式只能用 !important 压 */
.klp-ta-hooks .pipe, .klp-floor-meta .klp-floor-hook .pipe { display: none; }
.klp-ta-hooks > *, .klp-floor-meta .klp-floor-hook > * { float: none !important; padding: 0 !important; position: static !important; background: none; }
.klp-ta-hooks > :not(.pipe)::before, .klp-floor-meta .klp-floor-hook > :not(.pipe)::before { content: '·'; margin-right: 6px; color: var(--text-3); }
.klp-ta-hooks a, .klp-floor-meta .klp-floor-hook a { color: var(--text-3); }
.klp-ta-hooks a:hover, .klp-floor-meta .klp-floor-hook a:hover { color: var(--ink); }
.klp-ta-hooks code, .klp-floor-meta .klp-floor-hook code { font: inherit; color: var(--text-3); background: none; white-space: nowrap; }

/* 楼层「管理」勾选后的浮层 #mdly（klp.js 的 initModLayer 把它挪到 #append_parent）：
 * forum_moderator.css 给它写死 250px 宽 + 100px 高的背景图，新模板里挤成竖排；改成一条横向工具条 */
#mdly.klp-mdly { width: max-content; height: auto; padding: 0; margin: 0; background: none; line-height: 1.5; overflow: visible; }
#mdly.klp-mdly .fwin .m_c { padding: 0; }
#mdly.klp-mdly .f_c .c { display: flex; align-items: center; gap: 2px; padding: 6px; white-space: nowrap; }
#mdly.klp-mdly h3 { margin: 0 6px 0 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
#mdly.klp-mdly h3 strong { margin: 0 2px; font-family: var(--mono); color: var(--ink); }
#mdly.klp-mdly a { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: var(--r-sm); color: var(--text-2); font-size: 13px; }
#mdly.klp-mdly a:hover { background: var(--hover); color: var(--text); }
#mdly.klp-mdly a[onclick*="delpost"] { color: var(--danger); }
#mdly.klp-mdly a[onclick*="delpost"]:hover { background: var(--danger-soft); }
#mdly.klp-mdly .pipe { display: none; }

/* 帖子目录（[index]）：原版是 500px 定宽 + 位图小图标的框，换成和卡片一致的样子。
 * 点目录项切章节时 klp.js 给楼层加 .klp-tindex-loading、被点那项 .k-busy 转圈，回来后当前章节标 .on */
.klp-post .tindex { width: auto; max-width: 420px; margin: 0 0 16px; padding: 10px 6px 6px; line-height: 1.5; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.klp-post .tindex h3 { margin: 0 0 4px; padding: 0 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--text); }
.klp-post .tindex ul { margin: 0; padding: 0; list-style: none; }
.klp-post .tindex li { height: auto; padding: 5px 10px; background: none; border-radius: var(--r-sm); color: var(--text-2); cursor: pointer; overflow: hidden; }
.klp-post .tindex li:hover { background: var(--hover); color: var(--ink); }
.klp-post .tindex li.on { background: var(--soft); color: var(--soft-ink); font-weight: 500; }
.klp-post .tindex li.k-busy { cursor: progress; }
.klp-tindex-loading .t_f { opacity: .45; pointer-events: none; transition: opacity .15s; }

/* 评分弹窗（forum/rate.htm）：一行一种积分——名称、分值、可填区间、今日剩余四列对齐。
 * 原版输入框是 25px 定宽的 .px，新模板给 .px 加了 12px 内边距后里面的数字一个像素都露不出来 */
.klp-ratewin { box-sizing: border-box; width: 480px; max-width: calc(100vw - 32px); }
/* 积分项多的时候内容区自己滚动，别把底栏的汇总和「确定」顶出屏幕 */
.klp-ratewin > form > .c { max-height: min(62vh, 480px); overflow-y: auto; }
/* 不经弹窗直接打开 forum.php?mod=misc&action=rate 时，.tm_c 没有外面那张弹窗底板，自己补成卡片 */
.klp-ratewin-page { width: auto; max-width: 560px; margin: 24px auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.klp-ratewin-page > form > .c { max-height: none; }
.klp-rw-head, .klp-rw-row { display: grid; grid-template-columns: minmax(0, 1fr) 124px 112px 64px; align-items: center; column-gap: 10px; }
.klp-rw-head { padding: 2px 0 8px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.klp-rw-head span:nth-child(n+3), .klp-rw-range, .klp-rw-left { text-align: right; }
.klp-rw-row { padding: 10px 0; }
.klp-rw-row + .klp-rw-row { border-top: 1px dashed var(--line); }
.klp-rw-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.klp-rw-name img { width: 16px; height: 16px; }
.klp-rw-in { display: flex; align-items: center; gap: 6px; }
.klp-rw-num { flex: none; width: 92px; height: 34px; text-align: center; font-size: 15px; font-weight: 600; }
.klp-rw-num.is-bad { border-color: var(--danger); }
.klp-rw-num.is-bad:focus { border-color: var(--danger); box-shadow: none; }
.klp-rw-unit { font-size: 12.5px; font-style: normal; color: var(--text-3); }
.klp-rw-range, .klp-rw-left { font-size: 12.5px; color: var(--text-2); }
/* 提示挂在行的第二排、从分值那列起，不挤占名称 */
.klp-rw-tip { grid-column: 2 / -1; padding-top: 6px; font-size: 12.5px; color: var(--danger); }
.klp-rw-reason { margin-top: 16px; }
/* 常用理由条数由后台配，多了就在框内滚动，别把弹窗顶出屏幕 */
.klp-rw-tags { display: flex; flex-wrap: wrap; gap: 6px; max-height: 92px; margin: 10px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.klp-rw-tags li { display: inline-flex; align-items: center; max-width: 100%; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.klp-rw-tags li:hover { background: var(--hover); color: var(--text); }
.klp-rw-tags li.on { border-color: transparent; background: var(--soft); color: var(--soft-ink); font-weight: 600; }
.klp-rw-note { margin: 14px 0 0; font-size: 12.5px; color: var(--text-3); }
.klp-rw-sum { margin-right: auto; font-size: 13px; color: var(--text-2); }
.klp-rw-sum b { font-family: var(--mono); font-weight: 600; color: var(--text); }
.klp-rw-sum.is-empty { color: var(--text-3); }
.klp-rw-sum.is-bad { color: var(--danger); }
/* 撤销评分（removerate）：表格本身的换肤在 discuz.css 的弹窗通用一节 */
.klp-rwlog-s { font-family: var(--mono); font-weight: 600; color: var(--text); }
.klp-rwlog-why { width: 180px; height: 34px; }

/* ========== 投票（forum/viewthread_poll） ========== */
/* 宽度跟着选项文字走：短选项铺满整栏只剩一大片空进度条，所以给个下限、内容多了再撑开到整栏 */
.klp-poll { display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; width: fit-content; min-width: min(480px, 100%); max-width: 100%; margin-top: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); }
/* 图片投票是 auto-fill 网格，fit-content 下只能量出一列，仍按整栏排 */
.klp-poll:has(.klp-poll-imgs) { width: auto; }
.klp-poll-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.klp-poll-h .k-meta { font-size: 13px; }
/* .pcht 是 Discuz 原生类（脚本要找），原样式写死 width: 600px，在主栏里会撑出卡片 */
.klp-poll .pcht { width: auto; margin: 0; padding: 0; border: 0; }
.klp-poll-opts { display: flex; flex-direction: column; gap: 6px; }
.klp-poll-opt { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: border-color var(--dur-1) var(--ease-io), box-shadow var(--dur-1) var(--ease-io); }
.klp-poll-opt:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.klp-poll-opt:has(input:checked) { border-color: var(--brand); box-shadow: var(--ring); }
.klp-poll-row { display: flex; align-items: center; gap: 10px; }
.klp-poll-row input, .klp-poll-imgt input { flex: none; margin: 0; width: 16px; height: 16px; accent-color: var(--ink); }
.klp-poll-t { flex: 1; min-width: 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.klp-poll-n { flex: none; display: inline-flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--text-2); }
.klp-poll-n .k-meta { font-size: 12px; }
/* 原版 module.css 给 .pbg 写了 width: 80%，进度条轨道会短一截 */
.klp-poll .pbg { display: block; width: auto; height: 6px; }
.klp-poll .pbr { display: block; transition: width var(--dur-2) var(--ease); }
.klp-poll-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.klp-poll-img { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.klp-poll-img:has(input:checked) { border-color: var(--brand); box-shadow: var(--ring); }
.klp-poll-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm); cursor: zoom-in; }
.klp-poll-noimg { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: var(--r-sm); background: var(--bg); color: var(--text-3); }
.klp-poll-imgt { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.klp-poll-f { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.klp-poll-f:empty { display: none; }

/* ========== 辩论（forum/viewthread_debate） ========== */
.klp-dbt-verdict { margin-bottom: 16px; padding: 12px 16px; border-radius: var(--r-md); background: var(--bg); font-size: 14px; line-height: 1.7; }
.klp-dbt-verdict-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.klp-dbt-verdict p { margin: 0; color: var(--text-2); }
.klp-dbt { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); }
.klp-dbt-h { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.klp-dbt-bar { display: flex; height: 8px; overflow: hidden; border-radius: 999px; gap: 3px; }
.klp-dbt-bar-a { background: var(--danger); border-radius: 999px; transition: width var(--dur-2) var(--ease); }
.klp-dbt-bar-n { flex: 1; background: var(--info); border-radius: 999px; }
.klp-dbt-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.klp-dbt-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.klp-dbt-side-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.klp-dbt-side-h strong { font-size: 13px; font-weight: 600; }
.klp-dbt-a .klp-dbt-side-h strong, .klp-dbt-a .klp-dbt-pct { color: var(--danger); }
.klp-dbt-n .klp-dbt-side-h strong, .klp-dbt-n .klp-dbt-pct { color: var(--info); }
.klp-dbt-pct { font-size: 18px; font-weight: 600; }
.klp-dbt-point { flex: 1; margin: 0; font-size: 14px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.klp-dbt-side-f { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.klp-dbt-side-f .k-btn .k-mono { margin-left: 2px; color: var(--text-3); }
.klp-dbt-avs { display: flex; flex-wrap: wrap; gap: 4px; }
.klp-dbt-avs img { width: 100%; height: 100%; border-radius: 50%; }

/* ========== 活动（forum/viewthread_activity 的活动信息卡） ========== */
.klp-actv-card { display: flex; gap: 16px; margin-bottom: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); }
.klp-actv-cover { flex: none; width: 160px; }
.klp-actv-cover img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-md); cursor: zoom-in; }
.klp-actv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.klp-actv-h { display: flex; flex-wrap: wrap; gap: 6px; }
.klp-actv-kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.klp-actv-kv .k-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.klp-actv-f { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.klp-actv-stat { display: flex; gap: 16px; }
.klp-actv-stat strong { font-size: 18px; color: var(--ink); }
.klp-actv-stat .k-meta { font-size: 12.5px; }
/* 报名名单沿用原版的 .dt 表格 */
[id^="applylist_"] h2, .klp-actv-card ~ .ptm h2 { margin: 16px 0 8px; font-size: 14px; font-weight: 600; }
