/* 小黑屋 Pro · 原版 1.1.9 样式兼容层
   原则：只做交互/显示修复，绝不覆盖原版表格、徽章、卡片视觉。
   原版 original-style.css 先于本文件加载，本文件不应再改字体、间距、颜色、头像尺寸。 */

/* hidden 属性兜底：子比主题会给元素加 inline-flex/flex，导致 hidden 失效 */
.xhw-modal[hidden],
.xhw-toast[hidden],
.xhw-warning[hidden],
.xhw-maintenance[hidden],
[xhw-hidden] { display: none !important; }

/* 弹窗层级与关闭按钮可点，避免主题 z-index 抢事件 */
.xhw-modal .xhw-modal__panel { z-index: 2; }
.xhw-modal .xhw-modal__mask { z-index: 1; }
.xhw-modal .xhw-icon-btn { position: relative; z-index: 3; pointer-events: auto; }

/* 趋势图：PHP 已设 preserveAspectRatio="xMidYMid meet"，这里只确保不溢出 */
.xhw-chart-card__body svg { display: block; max-width: 100%; margin: 0 auto; }

/* 头像加载失败的首字母兜底（尺寸与原版 16px 一致，不强制放大） */
.xhw-user-avatar--fallback {
    display: inline-grid !important; place-items: center;
    width: 16px !important; height: 16px !important; min-width: 16px !important;
    border-radius: 50% !important; background: linear-gradient(135deg, #8b7cf6, #5b8ff9);
    color: #fff; font-size: 9px; font-weight: 700; line-height: 1; border: 0 !important;
}

/* 夜间模式：只补原版组件依赖的旧变量，具体视觉统一由 enhance.css 维护 */
:is(html.dark, html[data-theme="dark"], html[data-mode="dark"], body.dark, body.dark-theme, body.night) .xhw-container,
.xhw-container.xhw-night,
:is(html.dark, html[data-theme="dark"], html[data-mode="dark"], body.dark, body.dark-theme, body.night) .xhw-modal,
.xhw-modal.xhw-night,
:is(html.dark, html[data-theme="dark"], html[data-mode="dark"], body.dark, body.dark-theme, body.night) .xhw-toast,
.xhw-toast.xhw-night {
    --gray-50: #1f2738;
    --gray-100: #273044;
    --gray-200: #2f394f;
    --gray-300: #5c677d;
    --gray-400: #8b96ab;
    --gray-500: #b3bdcf;
    --gray-600: #d3dae8;
    --gray-700: #e7ecf7;
    --gray-800: #f1f4fa;
    --gray-900: #ffffff;
    --bg-color: transparent;
    --card-bg: #31343a;
    --text-color: #e7ecf7;
    --text-secondary: #96a1b7;
    --border-color: #45494f;
}

/* 移动端：原版已有响应式，这里只补充超出屏幕时的横向滚动 */
@media (max-width: 720px) {
    .xhw-table-wrapper { -webkit-overflow-scrolling: touch; }
}

/* ------------------------------------------------------------------
   封禁原因 / 补充说明
   原版会截断成 5 个字 + 省略号，并套用 .xhw-desc-tooltip（主题蓝字 + 虚线下划线），
   看起来像链接且内容看不全。这里改为完整显示、自然换行。
   ------------------------------------------------------------------ */
.xhw-table td.xhw-cell-reason,
.xhw-table td.xhw-cell-note {
    text-align: left !important;
    max-width: 340px;
}
.xhw-table .xhw-desc-text {
    display: inline;
    color: inherit;
    border-bottom: 0;
    text-decoration: none;
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: anywhere;
    cursor: text;
}
.xhw-table td.xhw-cell-reason > .xhw-cell-icon,
.xhw-table td.xhw-cell-note > .xhw-cell-icon {
    vertical-align: top;
    margin-top: 3px;
}

/* 用户名不再挂主题钩子，去除链接外观（子比会给链接加主色与下划线） */
.xhw-table .xhw-user-name-link {
    color: inherit;
    text-decoration: none;
    border: 0;
    cursor: inherit;
}

/* 防御：若主题全局脚本仍往表格内注入用户信息卡，一律不参与布局 */
.xhw-container .zib-author-card,
.xhw-container .author-card,
.xhw-container .zib-user-card,
.xhw-container .user-details,
.xhw-container .zib-author-card-wrapper {
    display: none !important;
}

/* 表头不换行：原因/说明列变宽后，原会被挤成「用户\n等级」「封禁\n时间」两行 */
.xhw-table thead th { white-space: nowrap; }
.xhw-table td.xhw-cell-reason,
.xhw-table td.xhw-cell-note { min-width: 96px; max-width: 260px; }

/* 原版 .xhw-page-header 的装饰伪元素：::before 用 '\f6e3' + 'Font Awesome 5 Free'，
   插件只内嵌 FA6，字形缺失会显示成「叉方框」；其余是 emoji，会渲染成彩色大图标。
   这里统一禁用，避免破图与杂影（hero 已不再使用该类，作为兜底）。 */
.xhw-page-header::before,
.xhw-page-header::after,
.xhw-page-header h1::before,
.xhw-page-header h1::after,
.xhw-page-header p::before,
.xhw-page-header p::after { content: none !important; display: none !important; }
