/**
 * 反向提示词：弹窗 + 主面板输入区
 * 独立命名空间 .ai-generate-negative-prompt-*，不与其他面板通用
 * 字体：Microsoft YaHei（项目规范）
 */

/* ---------- 主面板：添加按钮下方的输入框区域（确认后显示） ---------- */
.ai-generate-negative-prompt__input-wrap {
    width: 100%;
    margin-top: 8px;
    display: none;
}

.ai-generate-negative-prompt__input-wrap.ai-generate-negative-prompt__input-wrap--visible {
    display: flex;
    flex: 1;
    min-height: 72px;
    flex-direction: column;
}

.ai-generate-negative-prompt__textarea {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    width: 100%;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #e5e5e5;
    resize: vertical;
    box-sizing: border-box;
    scrollbar-color: rgba(255, 255, 255, 0.15) rgba(0, 0, 0, 0.35);
    scrollbar-width: thin;
}

/* 当输入区延伸显示时：textarea 可垂直滚动，保留最小高度避免被压扁，禁用拖拽缩放 */
.ai-generate-negative-prompt__input-wrap--visible .ai-generate-negative-prompt__textarea {
    flex: 1;
    min-height: 72px;
    overflow-y: auto;
    resize: none;
}

.ai-generate-negative-prompt__textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.ai-generate-negative-prompt__textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* 主面板反向提示词输入框：深色滚动条（与深色主题一致，文生图/图生图共用） */
.ai-generate-negative-prompt__textarea::-webkit-scrollbar {
    width: 8px;
}

.ai-generate-negative-prompt__textarea::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}

.ai-generate-negative-prompt__textarea::-webkit-scrollbar-thumb {
    background: rgba(90, 90, 90, 0.9);
    border-radius: 4px;
}

.ai-generate-negative-prompt__textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 120, 120, 0.95);
}

.ai-generate-negative-prompt__textarea::-webkit-scrollbar-button {
    display: none;
}

.ai-generate-negative-prompt__textarea::-webkit-resizer {
    background: rgba(90, 90, 90, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.3);
}

/* ---------- 弹窗遮罩 ---------- */
.ai-generate-negative-prompt-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.ai-generate-negative-prompt-overlay[hidden] {
    display: none !important;
}

/* ---------- 弹窗主体 ---------- */
.ai-generate-negative-prompt-dialog {
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    box-sizing: border-box;
}

/* 顶部：标题 + 手动输入 */
.ai-generate-negative-prompt-dialog__top {
    flex-shrink: 0;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-generate-negative-prompt-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.ai-generate-negative-prompt-dialog__title {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #e5e5e5;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.ai-generate-negative-prompt-dialog__close {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 20px;
    line-height: 1;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.ai-generate-negative-prompt-dialog__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.ai-generate-negative-prompt-dialog__close:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.ai-generate-negative-prompt-dialog__input {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    width: 100%;
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #e5e5e5;
    resize: vertical;
    box-sizing: border-box;
}

.ai-generate-negative-prompt-dialog__input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.ai-generate-negative-prompt-dialog__input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* 顶部输入框滚动条：深色 */
.ai-generate-negative-prompt-dialog__input::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ai-generate-negative-prompt-dialog__input::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}

.ai-generate-negative-prompt-dialog__input::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.ai-generate-negative-prompt-dialog__input::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* 中部：左侧分类 + 右侧词汇 */
.ai-generate-negative-prompt-dialog__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
}

.ai-generate-negative-prompt-dialog__nav {
    flex-shrink: 0;
    width: 120px;
    padding: 12px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.ai-generate-negative-prompt-dialog__nav-item {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 13px;
    line-height: 1.4;
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: none;
    border-left: 3px solid transparent;
    margin: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    text-align: left;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    box-sizing: border-box;
}

.ai-generate-negative-prompt-dialog__nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.ai-generate-negative-prompt-dialog__nav-item--active {
    color: #fff;
    font-weight: bold;
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
}

/* 右侧：工具栏 + 词汇区 */
.ai-generate-negative-prompt-dialog__words-right {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-generate-negative-prompt-dialog__words-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-generate-negative-prompt-dialog__words-toolbar-btn {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 12px;
    line-height: 1.4;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.ai-generate-negative-prompt-dialog__words-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.ai-generate-negative-prompt-dialog__words-empty {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
    padding: 16px 0;
    line-height: 1.4;
}

.ai-generate-negative-prompt-dialog__words {
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
}

.ai-generate-negative-prompt-dialog__tag {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 12px;
    line-height: 1.4;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.ai-generate-negative-prompt-dialog__tag:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.ai-generate-negative-prompt-dialog__tag--selected {
    background: rgba(22, 163, 74, 0.25);
    border-color: #16a34a;
    color: #fff;
}

.ai-generate-negative-prompt-dialog__tag--selected:hover {
    background: rgba(22, 163, 74, 0.35);
    border-color: #22c55e;
}

/* 底部：已选汇总 + 取消/确认 */
.ai-generate-negative-prompt-dialog__footer {
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-generate-negative-prompt-dialog__selected-wrap {
    min-height: 40px;
    padding: 8px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ai-generate-negative-prompt-dialog__selected-tag {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 12px;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(22, 163, 74, 0.2);
    border: 1px solid rgba(22, 163, 74, 0.4);
    color: rgba(255, 255, 255, 0.95);
}

.ai-generate-negative-prompt-dialog__selected-tag-remove {
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: color 0.2s, background 0.2s;
}

.ai-generate-negative-prompt-dialog__selected-tag-remove:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.ai-generate-negative-prompt-dialog__buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ai-generate-negative-prompt-dialog__btn {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 13px;
    line-height: 1.4;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    border: 1px solid transparent;
    box-sizing: border-box;
}

.ai-generate-negative-prompt-dialog__btn--secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.ai-generate-negative-prompt-dialog__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.ai-generate-negative-prompt-dialog__btn--primary {
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    border: none;
}

.ai-generate-negative-prompt-dialog__btn--primary:hover {
    opacity: 0.95;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

/* 弹窗内滚动条（仅本模块） */
.ai-generate-negative-prompt-dialog__words::-webkit-scrollbar {
    width: 8px;
}

.ai-generate-negative-prompt-dialog__words::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
}

.ai-generate-negative-prompt-dialog__words::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.ai-generate-negative-prompt-dialog__words::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
