/* book_writer Aitoimg 风格覆盖样式 */

/* 覆盖原有的颜色变量 */
:root {
  --bg-dark: #0b0717 !important;
  --bg-darker: #07060d !important;
  --bg-light: rgba(16, 14, 26, 0.7) !important;
  --bg-hover: rgba(139, 92, 246, 0.2) !important;
  --accent: #8b5cf6 !important;
  --text-main: rgba(255, 255, 255, 0.92) !important;
  --text-sub: rgba(255, 255, 255, 0.6) !important;
  --border: rgba(255, 255, 255, 0.08) !important;
  --danger: #ef4444 !important;
}

body,
html {
  background: radial-gradient(1200px 700px at 50% -120px, rgba(139, 92, 246, 0.35), transparent 60%),
    radial-gradient(900px 500px at 10% 0%, rgba(99, 102, 241, 0.22), transparent 55%),
    linear-gradient(180deg, #0b0717, #07060d) !important;
  background-attachment: fixed;
}

.top-bar,
.editor-header {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0)) !important;
  backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 搜索框样式 */
.search-box,
.search-input {
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(0, 0, 0, 0.18) !important;
}

.search-input:focus {
  border-color: rgba(139, 92, 246, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14) !important;
}

/* 按钮样式 */
.btn-primary,
button.btn-primary {
  border-radius: 10px !important;
  border: 1px solid rgba(139, 92, 246, 0.5) !important;
  background: rgba(139, 92, 246, 0.2) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

.btn-primary:hover {
  background: rgba(139, 92, 246, 0.3) !important;
  border-color: rgba(139, 92, 246, 0.7) !important;
}

.btn-secondary,
.btn-tool,
button.btn-secondary,
button.btn-tool {
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

.btn-secondary:hover,
.btn-tool:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

/* 书籍卡片 */
.books-grid > div,
.book-card {
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)) !important;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45) !important;
}

.books-grid > div:hover,
.book-card:hover {
  border-color: rgba(139, 92, 246, 0.45) !important;
  transform: translateY(-2px);
}

/* 侧边栏 */
.sidebar-tree,
.sidebar-ai {
  background: rgba(16, 14, 26, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(14px) !important;
}

/* 主编辑器 */
.main-editor {
  background: rgba(16, 14, 26, 0.45) !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 树节点 */
.tree-content .tree-node,
.tree-item {
  border-radius: 10px !important;
  background: rgba(0, 0, 0, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.tree-content .tree-node:hover,
.tree-item:hover {
  border-color: rgba(139, 92, 246, 0.45) !important;
  background: rgba(139, 92, 246, 0.06) !important;
}

.tree-content .tree-node.active,
.tree-item.active {
  background: rgba(139, 92, 246, 0.2) !important;
  border-color: rgba(139, 92, 246, 0.5) !important;
}

/* AI 卡片 */
.ai-card {
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(0, 0, 0, 0.18) !important;
  transition: all 0.2s !important;
}

.ai-card:hover {
  border-color: rgba(139, 92, 246, 0.45) !important;
  background: rgba(139, 92, 246, 0.06) !important;
  transform: translateY(-2px);
}

/* 图标盒子 */
.icon-box {
  border-radius: 10px !important;
}

.icon-box.blue {
  background: rgba(139, 92, 246, 0.2) !important;
  border: 1px solid rgba(139, 92, 246, 0.5) !important;
}

.icon-box.green {
  background: rgba(103, 194, 58, 0.2) !important;
  border: 1px solid rgba(103, 194, 58, 0.5) !important;
}

.icon-box.purple {
  background: rgba(168, 85, 247, 0.2) !important;
  border: 1px solid rgba(168, 85, 247, 0.5) !important;
}

/* 模态框 */
.modal-box,
.modal-overlay .modal-box {
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: linear-gradient(180deg, rgba(18, 14, 30, 0.96), rgba(10, 8, 16, 0.96)) !important;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(14px) !important;
}

.modal-overlay {
  background: rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(10px) !important;
}

#custom-modal-overlay {
  padding: 20px !important;
}

#custom-modal-overlay .modal-box {
  width: min(460px, calc(100vw - 32px)) !important;
  min-width: 320px !important;
  overflow: hidden !important;
}

#custom-modal-overlay .modal-header {
  min-height: 56px !important;
  padding: 0 16px 0 18px !important;
}

#custom-modal-overlay #modal-title {
  font-size: 18px !important;
  font-weight: 800 !important;
  color: rgba(255, 255, 255, 0.96) !important;
  letter-spacing: 0.2px !important;
}

#custom-modal-overlay .modal-close {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 10px !important;
  background: rgba(0, 0, 0, 0.2) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 24px !important;
  line-height: 1 !important;
  padding: 0 !important;
}

#custom-modal-overlay .modal-close:hover {
  border-color: rgba(139, 92, 246, 0.55) !important;
  background: rgba(139, 92, 246, 0.18) !important;
}

#custom-modal-overlay .modal-body {
  padding: 18px !important;
}

#custom-modal-overlay #modal-message {
  margin: 0 0 10px !important;
  font-size: 16px !important;
  line-height: 1.45 !important;
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 700 !important;
}

#custom-modal-overlay #modal-input-container {
  margin-top: 8px !important;
}

#custom-modal-overlay #modal-input {
  width: 100% !important;
  height: 42px !important;
  font-size: 14px !important;
  padding: 0 14px !important;
}

#custom-modal-overlay #modal-input::placeholder {
  color: rgba(255, 255, 255, 0.45) !important;
}

#custom-modal-overlay .modal-footer {
  padding: 14px 18px 18px !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

#custom-modal-overlay .modal-footer button {
  min-width: 86px !important;
  height: 36px !important;
  border-radius: 10px !important;
}

/* 输入框和文本域 */
input[type="text"],
input[type="search"],
textarea,
select,
.search-input,
.modal-text-input {
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(0, 0, 0, 0.18) !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

input:focus,
textarea:focus,
select:focus,
.search-input:focus {
  border-color: rgba(139, 92, 246, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14) !important;
  outline: none !important;
}

/* 工具栏 */
.bw-kb-toolbar {
  background: rgba(16, 14, 26, 0.7) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(14px) !important;
}

.bw-kb-toolbar-btn {
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(0, 0, 0, 0.18) !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

.bw-kb-toolbar-btn:hover {
  background: rgba(139, 92, 246, 0.2) !important;
  border-color: rgba(139, 92, 246, 0.5) !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

.bw-kb-toolbar-btn.active {
  background: rgba(139, 92, 246, 0.3) !important;
  border-color: rgba(139, 92, 246, 0.7) !important;
  color: #fff !important;
}

.bw-kb-toolbar-select {
  background: rgba(0, 0, 0, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  border-radius: 8px !important;
}

.bw-kb-content {
  background: rgba(0, 0, 0, 0.18) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
}

/* 排序选择框 */
.sort-select {
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(0, 0, 0, 0.18) !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

/* 面板头部 */
.panel-header,
.tree-header,
.ai-header {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0)) !important;
  backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 标签 */
.tag,
.kb-tag {
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(0, 0, 0, 0.18) !important;
}

.tag:hover,
.kb-tag:hover {
  border-color: rgba(139, 92, 246, 0.45) !important;
  background: rgba(139, 92, 246, 0.06) !important;
}

/* 颜色选项 */
.color-option {
  border-radius: 8px !important;
  border: 2px solid rgba(255, 255, 255, 0.12) !important;
  transition: all 0.2s !important;
}

.color-option:hover {
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: scale(1.1);
}

.color-option.selected {
  border-color: rgba(139, 92, 246, 0.7) !important;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14) !important;
}

/* 聊天输入框 */
.chat-input-box {
  background: rgba(16, 14, 26, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  backdrop-filter: blur(14px) !important;
}

.chat-input-box textarea {
  background: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

.chat-input-box button {
  border-radius: 10px !important;
  background: rgba(139, 92, 246, 0.2) !important;
  border: 1px solid rgba(139, 92, 246, 0.5) !important;
}

.chat-input-box button:hover {
  background: rgba(139, 92, 246, 0.3) !important;
  border-color: rgba(139, 92, 246, 0.7) !important;
}

/* 消息气泡 */
.message-bubble,
.ai-message {
  border-radius: 14px !important;
  background: rgba(16, 14, 26, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.75) rgba(255, 255, 255, 0.06);
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.86), rgba(99, 102, 241, 0.72));
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.92), rgba(129, 140, 248, 0.82));
}

/* 导出路径组 */
.export-path-group input {
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(0, 0, 0, 0.18) !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

/* 图标按钮 */
.btn-icon,
.btn-icon-small,
.icon-btn {
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

.btn-icon:hover,
.btn-icon-small:hover,
.icon-btn:hover {
  background: rgba(139, 92, 246, 0.2) !important;
  border-color: rgba(139, 92, 246, 0.5) !important;
}

/* 危险按钮 */
.btn-tool.danger,
.danger {
  border-color: rgba(239, 68, 68, 0.5) !important;
  background: rgba(239, 68, 68, 0.1) !important;
  color: rgba(239, 68, 68, 0.9) !important;
}

.btn-tool.danger:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.7) !important;
}

/* 上下文菜单 */
.context-menu {
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(18, 14, 30, 0.96) !important;
  backdrop-filter: blur(14px) !important;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45) !important;
}

.menu-item {
  border-radius: 8px !important;
}

.menu-item:hover {
  background: rgba(139, 92, 246, 0.2) !important;
}

/* 紧凑模态框 */
.compact-modal-box {
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: linear-gradient(180deg, rgba(18, 14, 30, 0.96), rgba(10, 8, 16, 0.96)) !important;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6) !important;
}

/* AI 结果模态框 */
.ai-result-modal-box,
.kb-compare-modal-box {
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: linear-gradient(180deg, rgba(18, 14, 30, 0.96), rgba(10, 8, 16, 0.96)) !important;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6) !important;
}

/* 选择框选项 */
select option {
  background: rgba(18, 14, 30, 0.96) !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

/* 标题输入 */
.title-input,
.chapter-title-input {
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(0, 0, 0, 0.18) !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

.title-input:focus,
.chapter-title-input:focus {
  border-color: rgba(139, 92, 246, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14) !important;
}

/* 编辑器容器 */
#editor-container {
  background: rgba(0, 0, 0, 0.18) !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 知识库模块 */
.kb-module {
  background: rgba(16, 14, 26, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
}

.kb-header {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0)) !important;
  backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.kb-btn {
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

.kb-btn:hover {
  background: rgba(139, 92, 246, 0.2) !important;
  border-color: rgba(139, 92, 246, 0.5) !important;
}

/* 标签行 */
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* AI 动作区域 */
.ai-actions {
  display: grid;
  gap: 12px;
}

/* 调整器 */
.bw-resizer {
  background: rgba(255, 255, 255, 0.08) !important;
}

.bw-resizer:hover {
  background: rgba(139, 92, 246, 0.5) !important;
}
