/**
 * AI Interact App 现代扁平化样式 (Restored)
 * 风格：Apple / Linear 风格，注重留白、排版和微交互
 */

/* 1. 全局重置与容器 */
.xh-modern-container {
    max-width: 1100px;
    margin: 20px auto 40px;
    padding-top: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    color: #1a1a1a;
    background: transparent;
}

/* 2. 极简 Header - 添加背景模块化 */
.xh-modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 20px 24px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e5e5;
}

/* 请求消耗说明框 */
.request-info-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    margin-top: -20px;
    margin-bottom: 24px;
}

.request-info-banner .info-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.request-info-banner .info-text {
    font-size: 13px;
    color: #0369a1;
    line-height: 1.5;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.brand-logo svg {
    width: 24px;
    height: 24px;
}

.brand-logo-bg {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    padding: 10px;
    border-radius: 12px;
    color: #0284c7;
}

.brand-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #000;
}

.header-nav {
    display: flex;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item svg {
    width: 14px;
    height: 14px;
}

.nav-item:hover {
    color: #000;
}

.nav-item.active {
    background: #fff;
    color: #000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* 3. 主布局 (Sidebar + Content) */
.settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
}

/* 左侧列容器 */
.settings-left-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 侧边栏通用模块样式 */
.sidebar-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.sidebar-box-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

/* 反馈模块 - 无边框简洁风格 */
.feedback-box {
    background: transparent;
    border: none;
    padding: 12px 0;
}

.feedback-box .sidebar-box-title {
    text-align: center;
}

.feedback-box .feedback-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-box .feedback-qrcode {
    text-align: center;
}

.feedback-box .feedback-qrcode img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.feedback-box .qrcode-label {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #888;
}

.feedback-box .feedback-email {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
}

.feedback-box .email-icon {
    font-size: 14px;
}

.feedback-box .feedback-email a {
    color: #0369a1;
    text-decoration: none;
}

.feedback-box .feedback-email a:hover {
    text-decoration: underline;
}

/* 提示模块 - 高亮样式 + 阴影 */
.tips-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #bae6fd;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.08);
}

.tips-box .tips-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tips-box .tips-box-title {
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
}

.tips-box .tips-box-icon {
    font-size: 18px;
}

.tips-box .tips-box-text {
    font-size: 12px;
    color: #0c4a6e;
    line-height: 1.7;
    margin: 0;
}

/* 侧边栏菜单 - 新版卡片式设计 */
.settings-sidebar {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e5e5;
    overflow: hidden;
    height: fit-content;
}

/* 侧边栏标题 */
.sidebar-header-title {
    font-size: 11px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 16px 4px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    color: #555;
    font-weight: 500;
    margin-bottom: 2px;
}

.menu-item:hover {
    background: #f5f5f7;
    color: #000;
}

.menu-item.active {
    background: #f0f0f1;
    color: #000;
    font-weight: 600;
}

.item-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    opacity: 0.8;
}

.item-text {
    flex: 1;
    font-size: 14px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff;
}

/* 侧边栏微型统计 - 集成在 sidebar 底部 */
.sidebar-stats {
    background: #fafafa;
    border-top: 1px solid #eee;
    padding: 20px;
    margin: 0;
    border-radius: 0;
}

.stat-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.stat-mini:last-child {
    margin-bottom: 0;
}

.stat-mini label {
    color: #666;
}

.stat-mini strong {
    font-size: 14px;
}

.audit-stats {
    font-size: 13px;
    font-weight: 600;
}

.audit-approved {
    color: #10b981;
}

.audit-separator {
    color: #ccc;
    margin: 0 2px;
}

.audit-rejected {
    color: #ef4444;
}

/* 侧边栏反馈模块 */
.sidebar-feedback {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.feedback-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.feedback-desc {
    font-size: 11px;
    color: #888;
    margin: 0 0 10px;
}

.feedback-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #0369a1;
    text-decoration: none;
    transition: color 0.2s;
}

.feedback-link:hover {
    color: #0284c7;
}

.feedback-icon {
    font-size: 14px;
}

.feedback-qrcode {
    margin-top: 8px;
    text-align: center;
}

.feedback-qrcode img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* 4. 配置面板 (右侧内容区) */
.config-panel {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e5e5;
    padding: 0;
    min-height: 400px;
    overflow: hidden;
}

/* 面板头部 - 开关区域独立模块 */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px;
    border-bottom: 1px solid #e5e5e5;
    gap: 24px;
}

.panel-title-section {
    flex: 1;
    min-width: 0;
}

.panel-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #000;
}

.panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.panel-icon svg {
    width: 20px;
    height: 20px;
}

.panel-desc {
    font-size: 13px;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

/* 面板主体 */
.panel-body {
    padding: 28px;
}

/* 禁用状态面板 - 视觉变灰但可见 */
.panel-body.panel-disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.8);
    transition: all 0.3s ease;
}

/* 5. 表单元素优化 - 统一样式 */
.form-group {
    margin-bottom: 32px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #111;
    margin-bottom: 6px;
    position: relative;
    padding-left: 14px;
}

.form-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background: linear-gradient(180deg, #0ea5e9 0%, #38bdf8 100%);
    border-radius: 2px;
}

.form-help {
    font-size: 13px;
    color: #777;
    margin: 0 0 16px;
    padding-left: 14px;
    line-height: 1.6;
}

/* 控件区域 - 统一缩进对齐 */
.form-control-area {
    margin-left: 14px;
    padding-right: 14px;
}

/* 设置项容器 - 与描述文字对齐（兼容未包裹的控件） */
.form-group>.components-radio-control,
.form-group>.components-checkbox-control,
.form-group>.grid-checkboxes,
.form-group>.radio-cards,
.form-group>.action-radios,
.form-group>.style-checkbox-row,
.form-group>.exception-checkbox-grid,
.form-group>.range-group,
.form-group>.dual-range-slider,
.form-group>.keyword-input-wrapper,
.form-group>.components-range-control {
    margin-left: 14px;
}

.form-label-with-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.form-label-with-toggle .components-toggle-control {
    margin: 0;
}

.form-divider {
    height: 1px;
    background: linear-gradient(90deg, #e5e5e5 0%, #f5f5f5 100%);
    margin: 36px 0;
}

.form-section-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #aaa;
    font-weight: 700;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e5e5e5;
}

.form-row {
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
}

.form-row .half {
    flex: 1;
}

/* 背景框，用于分组（子级设置模块） */
.bg-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

/* 子级模块内的标题 - 无蓝色标记，更小字号 */
.bg-box .form-label {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    padding-left: 0;
    margin-bottom: 4px;
}

.bg-box .form-label::before {
    display: none;
}

.bg-box .form-help {
    font-size: 12px;
    color: #888;
    padding-left: 0;
    margin-bottom: 12px;
}

/* 子级模块内的控件区域 - 无额外缩进 */
.bg-box .form-control-area,
.bg-box .keyword-input-wrapper,
.bg-box .components-range-control {
    margin-left: 0;
    padding-right: 0;
}

/* 自定义 Checkbox Grid */
.grid-checkboxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.checkbox-card {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: border 0.2s;
}

.checkbox-card:hover {
    border-color: #ddd;
}

.checkbox-card .components-checkbox-control {
    margin-bottom: 4px;
}

.checkbox-desc {
    font-size: 11px;
    color: #888;
    margin-left: 25px;
    margin-top: -5px;
}

/* 强制勾选项视觉样式 */
.checkbox-card.checkbox-forced {
    background: #f5f5f5;
    border-color: #e0e0e0;
    opacity: 0.75;
}

.checkbox-card.checkbox-forced .components-checkbox-control__label {
    color: #777;
}

.checkbox-card.checkbox-forced .checkbox-desc {
    color: #999;
}

/* 动画 */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* WordPress 组件覆盖 - ToggleControl */
.components-toggle-control .components-form-toggle {
    width: 40px;
    height: 24px;
}

.components-toggle-control .components-form-toggle__track {
    width: 40px;
    height: 24px;
    border-radius: 12px;
    border: 2px solid #757575;
    background-color: #fff;
    /* 默认关闭状态 */
}

.components-toggle-control .components-form-toggle.is-checked .components-form-toggle__track {
    background-color: #000 !important;
    border-color: #000;
}

.components-toggle-control .components-form-toggle__thumb {
    width: 16px;
    height: 16px;
    border-width: 0;
    top: 4px;
    left: 4px;
    background-color: #757575;
    box-shadow: none;
}

.components-toggle-control .components-form-toggle.is-checked .components-form-toggle__thumb {
    background-color: #fff;
    transform: translateX(16px);
}

/* Save Button States */
/* Save Button & Wrapper */
.save-button-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.save-indicator-text {
    position: absolute;
    right: 100%;
    margin-right: 12px;
    white-space: nowrap;
    font-size: 12px;
    color: #f59e0b;
    /* Amber/Orange warning color */
    font-weight: 500;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
}

.save-indicator-text.save-success {
    color: #10b981;
    /* Green success color */
}

.components-button.is-primary.xh-save-button {
    background-color: #000;
    color: #fff;
    border: none;
    box-shadow: none;
    transition: background-color 0.2s ease;
    padding: 8px 20px;
    border-radius: 8px;
}

.components-button.is-primary.xh-save-button:hover {
    background-color: #333;
    transform: none;
    /* Disable hover movement */
    box-shadow: none;
}

.components-button.is-primary.xh-save-button:focus {
    box-shadow: none;
    background-color: #333;
}

.components-button.is-primary.xh-save-button:disabled {
    opacity: 0.7;
    background-color: #000;
}

.components-range-control__wrapper {
    margin-top: 6px;
}

/* 6. RadioControl 样式覆盖 - 扁平化设计 */
.components-radio-control__option {
    margin-bottom: 8px;
}

.components-radio-control__option:last-child {
    margin-bottom: 0;
}

.components-radio-control__input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    margin-right: 6px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.components-radio-control__input[type="radio"]:hover {
    border-color: #9ca3af;
}

.components-radio-control__input[type="radio"]:checked {
    border-color: #000;
    background: #000;
    box-shadow: inset 0 0 0 3px #fff;
}

/* 隐藏默认的 :before 伪元素 */
.components-radio-control__input[type="radio"]:checked::before {
    display: none !important;
}

.components-radio-control__option label {
    font-size: 14px;
    color: #444;
    font-weight: 400;
    cursor: pointer;
}

/* 7. CheckboxControl 样式覆盖 - 扁平化设计 */
.components-checkbox-control__input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    margin-right: 10px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.components-checkbox-control__input[type="checkbox"]:hover {
    border-color: #9ca3af;
}

.components-checkbox-control__input[type="checkbox"]:checked {
    border-color: #000;
    background: #000;
}

.components-checkbox-control__input[type="checkbox"]:checked::before {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin: 1px 0 0 5px;
}

.components-checkbox-control__label {
    font-size: 14px;
    color: #444;
    font-weight: 400;
}

/* Checkbox stack 容器 */
.checkbox-stack .components-checkbox-control {
    margin-bottom: 10px;
}

.checkbox-stack .components-checkbox-control:last-child {
    margin-bottom: 0;
}

/* 8. RangeControl 样式优化 */
.components-range-control__slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    outline: none;
}

.components-range-control__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease;
}

.components-range-control__slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.components-range-control__slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.range-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.range-group .components-range-control {
    margin-bottom: 0;
}

.range-group .components-base-control__label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    margin-bottom: 4px;
}

/* 9. KeywordInput 子组件样式 */
.keyword-input-wrapper {
    width: calc(100% - 14px);
    box-sizing: border-box;
}

.keyword-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.keyword-text-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.keyword-text-input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.keyword-text-input::placeholder {
    color: #9ca3af;
}

.keyword-add-btn.components-button {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #333;
    transition: all 0.2s;
}

.keyword-add-btn.components-button:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.keyword-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* 马卡龙色系 - 柔和6色循环 */
.keyword-tag:nth-child(6n+1) {
    background: #bfdbfe;
    color: #1e40af;
}

/* 浅蓝 */
.keyword-tag:nth-child(6n+2) {
    background: #bbf7d0;
    color: #166534;
}

/* 浅绿 */
.keyword-tag:nth-child(6n+3) {
    background: #ddd6fe;
    color: #5b21b6;
}

/* 浅紫 */
.keyword-tag:nth-child(6n+4) {
    background: #fed7aa;
    color: #c2410c;
}

/* 浅橙 */
.keyword-tag:nth-child(6n+5) {
    background: #fecaca;
    color: #b91c1c;
}

/* 浅红 */
.keyword-tag:nth-child(6n+6) {
    background: #a5f3fc;
    color: #0e7490;
}

/* 浅青 */

.keyword-tag-remove {
    margin-left: 8px;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    transition: opacity 0.2s;
}

.keyword-tag-remove:hover {
    opacity: 1;
}

.keyword-empty-hint {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
    font-style: italic;
}

/* 10. UserSelector 子组件样式 */
.user-selector-wrapper {
    width: 100%;
    max-width: 400px;
}

.selected-users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.selected-user-tag {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 4px 12px 4px 4px;
    font-size: 13px;
}

.user-tag-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

.user-tag-name {
    color: #374151;
    font-weight: 500;
}

.user-tag-remove {
    margin-left: 8px;
    border: none;
    background: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.user-tag-remove:hover {
    color: #ef4444;
}

.user-empty-hint {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 0 12px;
    font-style: italic;
}

.user-search-container {
    position: relative;
}

.user-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.user-search-input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.user-search-input::placeholder {
    color: #9ca3af;
}

.user-search-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.user-search-dropdown {
    position: absolute;
    z-index: 100;
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    max-height: 200px;
    overflow-y: auto;
}

.user-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.user-search-item:last-child {
    border-bottom: none;
}

.user-search-item:hover {
    background: #f9fafb;
}

.user-search-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-search-info {
    display: flex;
    flex-direction: column;
}

.user-search-name {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

.user-search-email {
    font-size: 12px;
    color: #9ca3af;
}

.user-search-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
}

/* 11. ModeratorUserList 组件样式 */
.mod-user-list {
    width: 100%;
}

.mod-user-tip {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.mod-tip-icon {
    flex-shrink: 0;
}

.mod-tip-text {
    color: #92400e;
}

.mod-user-search {
    position: relative;
    margin-bottom: 16px;
}

.mod-search-input-wrap {
    position: relative;
}

.mod-search-input {
    width: 100%;
    padding: 8px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    background: #fff !important;
    height: auto !important;
    min-height: unset !important;
    box-shadow: none !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mod-search-input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.mod-search-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.mod-search-dropdown {
    position: absolute;
    z-index: 100;
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    max-height: 200px;
    overflow-y: auto;
}

.mod-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.mod-search-item:last-child {
    border-bottom: none;
}

.mod-search-item:hover {
    background: #f9fafb;
}

.mod-search-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.mod-search-info {
    display: flex;
    flex-direction: column;
}

.mod-search-name {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

.mod-search-email {
    font-size: 12px;
    color: #9ca3af;
}

.mod-search-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
}

.mod-user-items {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.mod-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
}

.mod-user-item:last-child {
    border-bottom: none;
}

.mod-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.mod-user-name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    min-width: 80px;
}

.mod-user-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.mod-user-tag.global {
    background: #dbeafe;
    color: #1d4ed8;
}

.mod-user-tag.posttype {
    background: #f3e8ff;
    color: #7c3aed;
}

.mod-user-tag.category {
    background: #dcfce7;
    color: #166534;
}

.mod-user-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.mod-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.mod-scope-btn.components-button {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    min-height: unset;
    height: auto;
    font-weight: 500;
}

.mod-scope-btn.components-button:hover:not(:disabled) {
    color: #000;
    background: #e5e7eb;
}

.mod-scope-btn.components-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mod-remove-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}

.mod-remove-btn:hover:not(:disabled) {
    background: #fee2e2;
    color: #ef4444;
}

.mod-remove-btn.disabled,
.mod-remove-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mod-empty-hint {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
    font-style: italic;
    padding: 20px;
    text-align: center;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
}

/* ModeratorUserList Modal */
.mod-scope-modal .components-modal__content {
    padding: 20px 24px;
}

.mod-modal-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 16px;
}

/* 分级选择器列表 */
.mod-scope-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.mod-scope-pt {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.mod-scope-pt:last-child {
    margin-bottom: 0;
}

.mod-scope-pt-check {
    padding: 12px 16px;
    margin: 0 !important;
    background: #f9fafb;
    border-bottom: 1px solid transparent;
}

.mod-scope-pt-check .components-checkbox-control__label {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.mod-scope-cats {
    padding: 12px 16px;
    background: #fff;
}

.mod-scope-mode {
    margin-bottom: 12px !important;
}

/* 单选选项横向排列靠左 */
.mod-scope-mode .components-flex {
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 16px;
}

.mod-scope-mode .components-radio-control__option {
    margin-bottom: 0;
}

/* 单选按钮标签字体缩小 */
.mod-scope-mode .components-radio-control__option label {
    font-size: 12px;
    color: #6b7280;
}

/* 修复单选按钮圆点变扁和选中状态不明显的问题 */
.mod-scope-mode .components-radio-control__input[type="radio"] {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    border-radius: 50% !important;
    border: 2px solid #d1d5db !important;
    box-shadow: none !important;
    background: #fff !important;
    margin-right: 6px !important;
}

.mod-scope-mode .components-radio-control__input[type="radio"]:checked {
    border-color: #000 !important;
    background-color: #000 !important;
    box-shadow: inset 0 0 0 3px #fff !important;
}

/* 隐藏导致显示问题的 :before 伪元素 */
.mod-scope-mode .components-radio-control__input[type="radio"]:checked::before {
    display: none !important;
}

.mod-scope-cat-list {
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

/* 分类复选框字体缩小 */
.mod-scope-cat-list .components-checkbox-control {
    margin: 0 !important;
}

.mod-scope-cat-list .components-checkbox-control__label {
    font-size: 12px;
    color: #374151;
}

.mod-scope-no-cats {
    padding: 8px 16px;
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

.mod-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* 12. 运作逻辑说明样式 */
.logic-notes {
    background: #eff6ff;
    border: 2px dashed #bfdbfe;
    border-radius: 10px;
    padding: 16px 20px;
}

.logic-notes-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.logic-notes-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
}

.logic-notes-icon svg {
    width: 16px;
    height: 16px;
}

.logic-notes-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
}

.logic-notes-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.logic-notes-list li {
    position: relative;
    padding-left: 16px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.6;
    margin-bottom: 6px;
}

.logic-notes-list li:last-child {
    margin-bottom: 0;
}

.logic-notes-list li::before {
    content: '•';
    position: absolute;
    left: 2px;
    color: #3b82f6;
    font-weight: 600;
}

/* 13. 警示注意事项样式（红色主题） */
.warning-notes {
    background: #fef2f2;
    border: 2px dashed #fecaca;
    border-radius: 10px;
    padding: 16px 20px;
}

.warning-notes-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.warning-notes-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
}

.warning-notes-icon svg {
    width: 16px;
    height: 16px;
}

.warning-notes-title {
    font-size: 13px;
    font-weight: 600;
    color: #991b1b;
}

.warning-notes-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.warning-notes-list li {
    position: relative;
    padding-left: 16px;
    font-size: 13px;
    color: #991b1b;
    line-height: 1.6;
    margin-bottom: 6px;
}

.warning-notes-list li:last-child {
    margin-bottom: 0;
}

.warning-notes-list li::before {
    content: '•';
    position: absolute;
    left: 2px;
    color: #ef4444;
    font-weight: 600;
}

/* 响应式 */
/* 11. 回复风格多选横向排列 */
.style-checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.style-checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.style-checkbox-item:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.style-checkbox-item.is-checked {
    border-color: #e5e7eb;
    background: #f5f5f7;
}

.style-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    margin-right: 8px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.15s ease;
}

.style-checkbox-item.is-checked input[type="checkbox"] {
    border-color: #000;
    background: #000;
}

.style-checkbox-item.is-checked input[type="checkbox"]::before {
    content: '';
    display: block;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin: 0 0 0 4px;
}

.style-checkbox-label {
    font-size: 14px;
    color: #333;
    font-weight: 400;
}

.style-checkbox-item.is-checked .style-checkbox-label {
    color: #333;
    font-weight: 400;
}

/* 12. 例外情况复选框网格 */
.exception-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.exception-checkbox-grid .components-checkbox-control {
    margin-bottom: 0;
}

/* 强制勾选项样式 - 灰色显示 */
.exception-checkbox-grid .components-checkbox-control:has(input:disabled) {
    opacity: 0.6;
}

.exception-checkbox-grid .components-checkbox-control:has(input:disabled) .components-checkbox-control__label {
    color: #666;
}

.exception-checkbox-grid .components-checkbox-control:has(input:disabled) input[type="checkbox"] {
    border-color: #9ca3af;
    background: #9ca3af;
    cursor: not-allowed;
}

/* 13. 双滑块范围选择器 */
.dual-range-slider {
    padding: 8px 0;
}

.dual-range-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
}

.dual-range-labels strong {
    color: #000;
    font-weight: 600;
}

.dual-range-track-wrap {
    position: relative;
    height: 20px;
    cursor: pointer;
}

.dual-range-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    transform: translateY(-50%);
}

.dual-range-highlight {
    position: absolute;
    top: 50%;
    height: 4px;
    background: #007cba;
    border-radius: 2px;
    transform: translateY(-50%);
}

.dual-range-thumb {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background: #007cba;
    border: 2px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    z-index: 2;
}

.dual-range-thumb:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dual-range-thumb.is-dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.dual-range-thumb-min {
    z-index: 3;
}

.dual-range-thumb-max {
    z-index: 2;
}

.dual-range-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #9ca3af;
}

@media (max-width: 800px) {
    .settings-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .settings-sidebar {
        flex-direction: row;
        overflow-x: auto;
        border-radius: 8px;
        /* Mobile adjustment */
        align-items: center;
        /* Center items */
    }

    .sidebar-menu {
        flex-direction: row;
        flex: 1;
        padding: 8px;
        /* Smaller padding */
    }

    .sidebar-stats {
        display: none;
        /* Hide stats on mobile if no space */
    }

    .form-row,
    .grid-checkboxes {
        flex-direction: column;
        grid-template-columns: 1fr;
    }
}