/* topic_readonly */
.topic-readonly-badge{display:inline-flex;align-items:center;gap:3px;margin-left:6px;padding:2px 8px;border-radius:999px;font-size:var(--font-size-xs);font-weight:600;line-height:1;white-space:nowrap;vertical-align:middle;background:var(--warning-soft);color:var(--warning);border:1px solid color-mix(in srgb,var(--warning) 24%,transparent)}
.topic-readonly-form{display:inline-flex;align-items:center}
/* 锁图标：完全同官方 icon-quote / icon-edit 的 mask 写法。
   官方 .icon-action:before 已提供 background:currentColor 与 14×14 尺寸；
   这里只追加 mask（mask 只取 SVG 的 alpha 通道，锁颜色 = 父级 color，自动适配明/暗主题）。
   mask 的 stroke 用 currentColor，与官方逐字一致。 */
.topic-readonly-state::before,
.icon-action.topic-readonly-toggle::before,
.post-action-form button.topic-readonly-toggle::before{
  content:"";
  width:14px;height:14px;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Crect x=%275%27 y=%2711%27 width=%2714%27 height=%2710%27 rx=%272%27/%3E%3Cpath d=%27M8 11V7a4 4 0 0 1 8 0v4%27/%3E%3C/svg%3E") center/14px 14px no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Crect x=%275%27 y=%2711%27 width=%2714%27 height=%2710%27 rx=%272%27/%3E%3Cpath d=%27M8 11V7a4 4 0 0 1 8 0v4%27/%3E%3C/svg%3E") center/14px 14px no-repeat;
}
/* 普通用户看到的"已只读"标记：红色加强警示（用户明确要求加重） */
.topic-readonly-state{color:var(--danger);opacity:1;border:0;background:transparent;font-weight:400}
.topic-readonly-state:hover{background:var(--line-soft);opacity:1}
/* 管理员"设为只读"按钮：彻底重置全局 .btn,button{color:var(--inverse-text);min-height:32px;padding:7px 13px;background:var(--brand)}。
   关键：用 .post-action-form button 提高特异性，确保 color 不被全局 button 覆盖（否则暗色下变 #111827）。 */
.post-action-form button.topic-readonly-toggle,
.post-action-form button.topic-readonly-toggle:hover{
  box-sizing:border-box;width:24px;height:24px;min-height:0;min-width:0;
  padding:0;margin:0;border:0;border-radius:var(--radius-sm);
  background:transparent;color:var(--text-muted);
  font:inherit;font-weight:400;line-height:1;cursor:pointer;
}
.post-action-form button.topic-readonly-toggle:hover{background:var(--line-soft);opacity:1;color:var(--text-muted)}
.post-action-form button.topic-readonly-toggle:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
/* 管理员"取消只读"按钮（已锁定）：warning 色，其余与未锁定一致，hover 背景统一 */
.post-action-form button.topic-readonly-toggle.is-locked,
.post-action-form button.topic-readonly-toggle.is-locked:hover{
  box-sizing:border-box;width:24px;height:24px;min-height:0;min-width:0;
  padding:0;margin:0;border:0;border-radius:var(--radius-sm);
  background:transparent;color:var(--warning);opacity:1;
  font:inherit;font-weight:400;line-height:1;cursor:pointer;
}
.post-action-form button.topic-readonly-toggle.is-locked:hover{background:var(--line-soft);opacity:1;color:var(--warning)}
.post-action-form button.topic-readonly-toggle.is-locked:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
/* 兼容旧兜底：嵌套 <i class="topic-readonly-icon-lock">（badge/notice 用），与 ::before 同款 mask 写法 */
.topic-readonly-icon-lock{display:inline-block;flex:0 0 auto;width:14px;height:14px;background-color:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Crect x=%275%27 y=%2711%27 width=%2714%27 height=%2710%27 rx=%272%27/%3E%3Cpath d=%27M8 11V7a4 4 0 0 1 8 0v4%27/%3E%3C/svg%3E") center/14px 14px no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Crect x=%275%27 y=%2711%27 width=%2714%27 height=%2710%27 rx=%272%27/%3E%3Cpath d=%27M8 11V7a4 4 0 0 1 8 0v4%27/%3E%3C/svg%3E") center/14px 14px no-repeat}
.topic-readonly-badge .topic-readonly-icon-lock{width:11px;height:11px}
.topic-readonly-notice .topic-readonly-icon-lock{width:15px;height:15px}
.topic-readonly-notice{display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid color-mix(in srgb,var(--warning) 28%,transparent);border-radius:var(--radius-sm);background:var(--warning-soft);color:var(--warning);font-size:var(--font-size-sm);line-height:1.5}
.topic-readonly-muted textarea,.topic-readonly-muted button[type="submit"]{display:none}
.topic-readonly-tip{margin:0;font-size:var(--font-size-xs);color:var(--text-subtle);line-height:1.6}
.topic-readonly-tip code{padding:1px 5px;border-radius:var(--radius-sm);background:var(--bg);font-size:var(--font-size-xxs)}
.topic-readonly-chips{display:flex;flex-wrap:wrap;gap:8px}
.topic-readonly-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border:1px solid var(--line-soft);border-radius:999px;background:var(--panel);color:var(--text-muted);font-size:var(--font-size-xs);line-height:1;white-space:nowrap}
.topic-readonly-chip b{color:var(--text);font-size:var(--font-size-sm)}
.topic-readonly-logs .topic-readonly-log{grid-template-columns:minmax(0,1fr) auto;gap:10px}
.topic-readonly-log-badge{display:inline-flex;align-items:center;padding:3px 9px;border:1px solid var(--line-soft);border-radius:999px;background:var(--panel);color:var(--text-muted);font-size:var(--font-size-xs);font-weight:600;line-height:1;white-space:nowrap}
.topic-readonly-log-badge.locked,.topic-readonly-log-badge.edit-topic,.topic-readonly-log-badge.edit-reply{border-color:color-mix(in srgb,var(--warning) 28%,transparent);background:var(--warning-soft);color:var(--warning)}
.topic-readonly-log-badge.unlocked{border-color:color-mix(in srgb,var(--success) 28%,transparent);background:var(--success-soft);color:var(--success)}
.topic-readonly-log-badge.delete-topic{border-color:color-mix(in srgb,var(--danger) 28%,transparent);background:var(--danger-soft);color:var(--danger)}
@media (max-width:600px){.topic-readonly-logs .topic-readonly-log{grid-template-columns:minmax(0,1fr)}.topic-readonly-logs .admin-row-side{justify-content:flex-start}}