/* 主容器 */
.worldbook-container {
  padding: 16px;
  background-color: var(--el-bg-color-page);
  min-height: 100vh;
  transition: background-color 0.3s;
}

/* 移动端布局 */
.worldbook-mobile-layout {
  display: block;
}

.worldbook-desktop-layout {
  display: none;
}

/* 标签页样式 */
.worldbook-tabs-mobile :deep(.el-tabs__content) {
  padding: 16px 0;
}

.worldbook-tab-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.worldbook-tab-icon {
  font-size: 16px;
}

.worldbook-tab-text {
  font-size: 14px;
}

.worldbook-tab-text-truncated {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 内容面板头部 */
.content-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--el-border-color-lighter);
}

.content-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--el-text-color-primary);
  margin: 0;
}

.content-panel-icon {
  font-size: 20px;
  color: #409eff;
}

.content-panel-text-highlight {
  color: #409eff;
  font-weight: 500;
}

.content-panel-text-truncated {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 按钮样式 */
.btn-primary-adv {
  background: #409eff;
  border: 1px solid #409eff;
  color: white;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary-adv:hover {
  background: #66b1ff;
  border-color: #66b1ff;
}

.btn-secondary-adv {
  background: #909399;
  border: 1px solid #909399;
  color: white;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary-adv:hover {
  background: #a6a9ad;
}

.btn-success-adv {
  background: #67c23a;
  border: 1px solid #67c23a;
  color: white;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-success-adv:hover {
  background: #85ce61;
}

.btn-warning-adv {
  background: #e6a23c;
  border: 1px solid #e6a23c;
  color: white;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-warning-adv:hover {
  background: #ebb563;
}

.btn-danger-adv {
  background: #f56c6c;
  border: 1px solid #f56c6c;
  color: white;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-danger-adv:hover {
  background: #f78989;
}

/* 禁用状态 */
.worldbook-button-disabled {
  opacity: 0.6;
}

/* 添加按钮 */
.worldbook-add-button {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.worldbook-add-icon {
  font-size: 20px;
}

/* 条目列表 */
.worldbook-entry-list-scrollbar {
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 4px;
  background: var(--el-bg-color);
}

.worldbook-empty-list {
  padding: 40px 20px;
}

.entry-menu {
  border: none;
}

.entry-menu-item {
  padding: 12px 16px;
  margin: 0;
  border-bottom: 1px solid var(--el-border-color-extra-light);
  transition: opacity 0.3s;
}

.entry-menu-item.is-disabled {
  opacity: 0.5;
}

.entry-menu-item-content {
  width: 100%;
}

.entry-menu-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.entry-menu-item-tags {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.entry-menu-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--el-text-color-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* 拖拽相关样式 */
.entry-menu-item-content {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.entry-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  cursor: grab;
  color: var(--el-text-color-placeholder);
  transition: color 0.2s;
  flex-shrink: 0;
}

.entry-drag-handle:hover {
  color: var(--el-text-color-regular);
}

.entry-drag-handle:active {
  cursor: grabbing;
}

.entry-drag-handle-icon {
  font-size: 16px;
}


/* vuedraggable 拖拽状态样式 */
.entry-chosen {
  opacity: 0.8;
  transform: scale(1.02);
  background-color: var(--el-color-primary-light-9) !important;
  border-color: var(--el-color-primary) !important;
  transition: all 0.2s;
}

.entry-drag {
  opacity: 0.6;
  transform: rotate(2deg);
  transition: all 0.2s;
}

.entry-ghost {
  opacity: 0.3;
  background-color: var(--el-color-primary-light-8);
  border: 2px dashed var(--el-color-primary);
}

/* 拖拽过程中的视觉反馈 */
.entry-menu-item:hover .entry-drag-handle {
  color: var(--el-color-primary);
}

.sortable-chosen .entry-drag-handle {
  color: var(--el-color-primary);
  cursor: grabbing;
}

/* 底部面板 */
.worldbook-bottom-panel-header {
  margin-top: 16px;
  margin-bottom: 0;
  padding-top: 16px;
  border-top: 1px solid var(--el-border-color-lighter);
  border-bottom: none;
}

.worldbook-bottom-panel-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.worldbook-bottom-button {
  border-radius: 50%;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.worldbook-bottom-button-icon {
  font-size: 16px;
}

.worldbook-bottom-button-text {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 4px;
}

.worldbook-button-text-icon {
  font-size: 14px;
}

.worldbook-button-text-short {
  display: inline;
}

.worldbook-button-text-long {
  display: none;
}

.worldbook-button-divider {
  width: 1px;
  height: 20px;
  background: var(--el-border-color-lighter);
  margin: 0 4px;
}

/* 编辑器按钮 */
.worldbook-editor-buttons {
  display: flex;
  gap: 8px;
}

.worldbook-editor-button {
  border-radius: 50%;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.worldbook-editor-button-icon {
  font-size: 16px;
}

.worldbook-editor-button-icon-delete {
  font-size: 16px;
}

/* 编辑器滚动区域 */
.worldbook-editor-scrollbar {
  height: calc(112vh - 200px);
  min-height: 400px;
}

.worldbook-editor-empty-state {
  padding: 80px 20px;
  text-align: center;
}

/* 表单样式 */
.worldbook-editor-form {
  padding: 16px;
}

.content-panel-body {
  background: var(--el-bg-color);
  border-radius: 4px;
  border: 1px solid var(--el-border-color-lighter);
}

.form-section {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--el-fill-color-extra-light);
  border-radius: 4px;
  border: 1px solid var(--el-border-color-extra-light);
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--el-text-color-primary);
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--el-border-color-lighter);
}

.form-section-icon {
  font-size: 18px;
  color: #409eff;
}

.form-section-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--el-text-color-primary);
  margin-bottom: 4px;
  display: block;
}

.form-label-subtext {
  font-weight: 400;
  color: var(--el-text-color-regular);
  font-size: 12px;
}

.form-help-text {
  font-size: 12px;
  color: var(--el-text-color-regular);
  margin: 4px 0 0 0;
  line-height: 1.4;
}

/* 网格布局 */
.form-grid-2-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.form-grid-3-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.form-grid-4-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.form-grid-3-col-top-align {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.form-grid-3-col-end-align {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.form-grid-span-2 {
  grid-column: span 1;
}

/* 弹性布局 */
.form-flex-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-flex-col-start {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.form-flex-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 表单控件 */
.form-full-width {
  width: 100%;
}

.form-slider {
  flex: 1;
}

.form-checkbox-padding {
  padding-top: 8px;
}

.form-checkbox-margin-top {
  margin-top: 8px;
}

.form-checkbox-nowrap {
  white-space: nowrap;
}

/* 桌面端布局 */
@media (min-width: 768px) {
  .worldbook-mobile-layout {
    display: none;
  }
  
  .worldbook-desktop-layout {
    display: flex;
    gap: 16px;
    height: calc(100vh - 32px);
  }
  
  .worldbook-desktop-panel-left {
    width: 320px;
    background: var(--el-bg-color);
    border-radius: 4px;
    border: 1px solid var(--el-border-color-lighter);
    padding: 16px;
    display: flex;
    flex-direction: column;
  }
  
  .worldbook-desktop-panel-right {
    flex: 1;
    background: var(--el-bg-color);
    border-radius: 4px;
    border: 1px solid var(--el-border-color-lighter);
    padding: 16px;
    display: flex;
    flex-direction: column;
  }
  
  .worldbook-add-button-desktop {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .worldbook-add-icon-desktop {
    font-size: 20px;
  }
  
  .worldbook-empty-list-desktop {
    padding: 60px 20px;
    text-align: center;
  }
  
  .worldbook-bottom-panel-header-desktop {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--el-border-color-lighter);
  }
  
  .worldbook-bottom-panel-buttons-desktop {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .worldbook-bottom-button-desktop {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .worldbook-bottom-button-icon-desktop {
    font-size: 16px;
  }
  
  .worldbook-bottom-button-icon-delete-desktop {
    font-size: 16px;
  }
  
  .worldbook-button-divider-desktop {
    width: 1px;
    height: 20px;
    background: var(--el-border-color-lighter);
    margin: 0 4px;
  }
  
  .worldbook-editor-buttons-desktop {
    display: flex;
    gap: 8px;
  }
  
  .worldbook-editor-button-desktop {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .worldbook-editor-button-icon-desktop {
    font-size: 16px;
  }
  
  .worldbook-editor-button-icon-delete-desktop {
    font-size: 16px;
  }
  
  .worldbook-editor-empty-state-desktop {
    padding: 100px 20px;
    text-align: center;
  }
  
  .worldbook-editor-form-desktop {
    padding: 16px;
  }
  
  /* 桌面端网格布局 */
  .form-grid-2-col {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid-3-col {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .form-grid-4-col {
    grid-template-columns: repeat(4, 1fr);
  }

  .form-grid-3-col-top-align {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .form-grid-3-col-end-align {
    grid-template-columns: 1fr 1fr 1fr;
  }
  
  .form-grid-span-2 {
    grid-column: span 2;
  }
  
  /* 桌面端按钮文本 */
  .worldbook-button-text-short {
    display: none;
  }
  
  .worldbook-button-text-long {
    display: inline;
  }
}

/* 响应式优化 */
@media (min-width: 1200px) {
  .worldbook-desktop-panel-left {
    width: 360px;
  }
}

/* 滚动条美化 */
:deep(.el-scrollbar__wrap) {
  overflow-x: hidden;
}

:deep(.el-scrollbar__bar) {
  opacity: 0.6;
}

/* Element Plus组件微调 */
:deep(.el-tabs__item) {
  padding: 0 16px;
}

:deep(.el-menu-item) {
  height: auto;
  min-height: 56px;
  line-height: 1.4;
}

.entry-menu .el-menu-item:hover {
  background-color: var(--el-fill-color-light);
}

.entry-menu .el-menu-item.is-active {
  background-color: var(--el-color-primary-light-9);
  color: var(--el-color-primary);
  font-weight: 600;
  border-left: 3px solid var(--el-color-primary);
  padding-left: calc(16px - 3px); /* Original padding is 16px, adjust for border */
}

.entry-menu .el-menu-item.is-active:focus {
  background-color: var(--el-color-primary-light-8);
}

:deep(.el-form-item) {
  margin-bottom: 16px;
}

:deep(.el-input__wrapper) {
  box-shadow: 0 0 0 1px var(--el-border-color) inset;
}

:deep(.el-input__wrapper:hover) {
  box-shadow: 0 0 0 1px var(--el-border-color-hover) inset;
}

:deep(.el-input__wrapper.is-focus) {
  box-shadow: 0 0 0 1px #409eff inset;
}

:deep(.el-textarea__inner) {
  box-shadow: 0 0 0 1px var(--el-border-color) inset;
}

:deep(.el-textarea__inner:hover) {
  box-shadow: 0 0 0 1px var(--el-border-color-hover) inset;
}

:deep(.el-textarea__inner:focus) {
  box-shadow: 0 0 0 1px #409eff inset;
}

/* 标签式输入框样式 */
:deep(.el-select__tags-text) {
  color: var(--el-color-primary-dark-2);
}

:deep(.el-tag--info .el-select__tags-text) {
  color: var(--el-color-info-dark-2);
}
.advanced-options-toggle {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color 0.2s;
  border-bottom: 1px solid var(--el-border-color-lighter);
  padding-bottom: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.advanced-options-toggle:hover {
  background-color: var(--el-fill-color-light);
}

.advanced-options-hint {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--el-text-color-placeholder);
}

.form-divider {
  border: none;
  border-top: 1px solid var(--el-border-color-lighter);
  margin: 8px 0;
}
/* Splitpanes 主题覆盖 */
.splitpanes.default-theme .splitpanes__pane {
  background-color: transparent;
}

.splitpanes.default-theme .splitpanes__splitter {
  background-color: var(--el-border-color-lighter);
  border-left: 1px solid var(--el-border-color-extra-light);
  border-right: 1px solid var(--el-border-color-extra-light);
  box-sizing: border-box;
  width: 7px;
  transition: background-color 0.2s;
}

.splitpanes.default-theme .splitpanes__splitter:hover {
  background-color: var(--el-color-primary-light-5);
}

.splitpanes.default-theme .splitpanes__splitter::before,
.splitpanes.default-theme .splitpanes__splitter::after {
  background-color: var(--el-text-color-secondary);
}

/* Responsive layout for form rows */
.form-row-responsive {
  display: flex;
  flex-direction: column;
  gap: 16px; /* Spacing for mobile view */
}

.form-group-responsive {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Desktop view: side-by-side layout */
@media (min-width: 768px) {
  .form-row-responsive {
    flex-direction: row;
    gap: 24px; /* Wider gap for desktop */
  }
  .form-group-responsive:first-child {
    flex: 1;
  }
  .form-group-responsive:last-child {
    flex: 3;
  }
}
.entry-navigation-buttons {
  margin-left: auto;
  display: flex;
  gap: 8px;
}