/* ========================================
   Worldbook CSS - 世界书管理页面
   iOS-like · 冷白/浅灰背景 · 移动端优先
   ======================================== */

/* ---- 世界书 CSS 变量 ---- */
:root {
  --worldbook-bg: #f7f7f8;
  --worldbook-card-bg: #ffffff;
  --worldbook-text-main: #1f1f1f;
  --worldbook-text-sub: #777777;
  --worldbook-text-hint: #aaaaaa;
  --worldbook-border: rgba(0, 0, 0, 0.06);
  --worldbook-active-bg: #111111;
  --worldbook-active-text: #ffffff;
  --worldbook-radius-lg: 18px;
  --worldbook-radius-md: 14px;
  --worldbook-radius-sm: 10px;
  --worldbook-tag-enabled: #e8f5e9;
  --worldbook-tag-enabled-text: #2e7d32;
  --worldbook-tag-disabled: #f0f0f0;
  --worldbook-tag-disabled-text: #999999;
  --worldbook-tag-draft: #fff8e1;
  --worldbook-tag-draft-text: #f57f17;
}

/* ---- 页面容器 ---- */
.worldbook-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--worldbook-bg);
  z-index: var(--z-drawer);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.worldbook-page.is-active {
  display: flex;
}

/* ---- 顶部导航栏 ---- */
.worldbook-header {
  height: var(--status-bar-height);
  margin-top: var(--safe-area-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-lg);
  background-color: var(--worldbook-bg);
  flex-shrink: 0;
  position: relative;
}

.worldbook-header__back {
  display: flex;
  align-items: center;
  color: var(--color-text-primary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-left: -8px;
}

.worldbook-header__back svg {
  width: 24px;
  height: 24px;
}

.worldbook-header__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--worldbook-text-main);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* 右侧按钮组 */
.worldbook-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.worldbook-manage-btn {
  background: none;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--worldbook-text-sub);
  font-family: var(--font-family);
  transition: color 0.15s ease;
}

.worldbook-manage-btn.is-active {
  color: #ff3b30;
}

.worldbook-create-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  font-family: var(--font-family);
}

.worldbook-create-btn svg {
  width: 18px;
  height: 18px;
}

/* ---- 可滚动内容区 ---- */
.worldbook-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--spacing-lg);
  padding-bottom: calc(24px + var(--safe-area-bottom, 0px));
}

/* ---- 1. 顶部说明卡片 ---- */
.worldbook-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--worldbook-card-bg);
  border-radius: var(--worldbook-radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--worldbook-border);
  box-shadow: var(--shadow-card);
}

.worldbook-hero-info {
  flex: 1;
  min-width: 0;
  padding-right: 16px;
}

.worldbook-hero-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--worldbook-text-main);
  margin-bottom: 6px;
  line-height: 1.3;
}

.worldbook-hero-desc {
  font-size: var(--font-size-sm);
  color: var(--worldbook-text-sub);
  line-height: 1.5;
}

.worldbook-hero-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f5f5f5;
  border-radius: 12px;
}

.worldbook-hero-icon svg {
  width: 26px;
  height: 26px;
  color: var(--worldbook-text-sub);
}

/* ---- 2. 分类横向筛选栏 ---- */
.worldbook-category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 14px;
  margin-bottom: 2px;
  /* 隐藏滚动条但保留滚动 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.worldbook-category-scroll::-webkit-scrollbar {
  display: none;
}

.worldbook-category-chip {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--worldbook-border);
  background: var(--worldbook-card-bg);
  color: var(--worldbook-text-sub);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  font-family: var(--font-family);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.worldbook-category-chip:active {
  opacity: 0.7;
}

.worldbook-category-chip.active {
  background: var(--worldbook-active-bg);
  color: var(--worldbook-active-text);
  border-color: var(--worldbook-active-bg);
}

/* 分类 chip 内部布局（含删除按钮） */
.worldbook-category-chip__label {
  pointer-events: none;
}

.worldbook-category-chip__delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  color: var(--worldbook-text-hint);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.worldbook-category-chip__delete:active {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
}

.worldbook-category-chip.active .worldbook-category-chip__delete {
  color: rgba(255, 255, 255, 0.6);
}

.worldbook-category-chip.active .worldbook-category-chip__delete:active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

/* 添加分类按钮 */
.worldbook-category-chip--add {
  border-style: dashed;
  color: var(--worldbook-text-hint);
  font-size: 16px;
  font-weight: 300;
  padding: 6px 14px;
}

.worldbook-category-chip--add:active {
  background: #f0f0f0;
  color: var(--worldbook-text-main);
}

/* ---- 3. 世界书条目列表 ---- */
.worldbook-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.worldbook-card {
  background: var(--worldbook-card-bg);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--worldbook-border);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  position: relative;
}

.worldbook-card:active {
  background-color: #fafafa;
}

.worldbook-card.is-selected {
  border-color: #ff3b30;
  background-color: #fff5f5;
}

/* 编辑模式下的复选框 */
.worldbook-card-checkbox {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d0d0d0;
  flex-shrink: 0;
  margin-right: 10px;
  margin-top: 2px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.worldbook-page.is-editing .worldbook-card-checkbox {
  display: flex;
}

.worldbook-card.is-selected .worldbook-card-checkbox {
  background: #ff3b30;
  border-color: #ff3b30;
}

.worldbook-card-checkbox__icon {
  width: 12px;
  height: 12px;
  color: #fff;
  display: none;
}

.worldbook-card.is-selected .worldbook-card-checkbox__icon {
  display: block;
}

.worldbook-card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.worldbook-card-body {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}

.worldbook-card-title {
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
  color: var(--worldbook-text-main);
  line-height: 1.3;
  margin-bottom: 6px;
}

.worldbook-card-desc {
  font-size: var(--font-size-sm);
  color: var(--worldbook-text-sub);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
}

.worldbook-card-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #c7c7cc;
}

.worldbook-card-action svg {
  width: 18px;
  height: 18px;
}

/* 底部 meta 行 */
.worldbook-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 标签通用 */
.worldbook-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: var(--font-weight-regular);
  line-height: 1.5;
  white-space: nowrap;
}

.worldbook-tag-category {
  background: #f0f0f5;
  color: #555555;
}

.worldbook-tag-enabled {
  background: var(--worldbook-tag-enabled);
  color: var(--worldbook-tag-enabled-text);
}

.worldbook-tag-disabled {
  background: var(--worldbook-tag-disabled);
  color: var(--worldbook-tag-disabled-text);
}

.worldbook-tag-draft {
  background: var(--worldbook-tag-draft);
  color: var(--worldbook-tag-draft-text);
}

.worldbook-card-time {
  font-size: 11px;
  color: var(--worldbook-text-hint);
  margin-left: auto;
}

/* ---- 4. 空状态 ---- */
.worldbook-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.worldbook-empty__icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
}

.worldbook-empty__icon svg {
  width: 100%;
  height: 100%;
}

.worldbook-empty__title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--worldbook-text-main);
  margin-bottom: 8px;
}

.worldbook-empty__desc {
  font-size: var(--font-size-sm);
  color: var(--worldbook-text-sub);
  line-height: 1.5;
  margin-bottom: 20px;
}

.worldbook-empty__btn {
  padding: 10px 28px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--worldbook-active-bg);
  color: var(--worldbook-active-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.worldbook-empty__btn:active {
  opacity: 0.7;
}

/* ---- 创建抽屉遮罩 ---- */
.worldbook-drawer-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-overlay);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.worldbook-drawer-mask.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* ---- 创建抽屉面板 ---- */
.worldbook-create-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--worldbook-card-bg);
  border-radius: 20px 20px 0 0;
  z-index: var(--z-modal);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  max-height: 85%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--safe-area-bottom, 0px) + 8px);
}

.worldbook-create-drawer.is-active {
  transform: translateY(0);
}

.worldbook-drawer-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px 8px;
  position: sticky;
  top: 0;
  background: var(--worldbook-card-bg);
}

.worldbook-drawer-header__bar {
  width: 36px;
  height: 4px;
  background: #e0e0e0;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.worldbook-drawer-header__title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--worldbook-text-main);
}

/* ---- 表单 ---- */
.worldbook-form {
  padding: 12px 20px 0;
}

.worldbook-form-group {
  margin-bottom: 16px;
}

.worldbook-form-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.worldbook-form-import-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 4px 10px;
  background: rgba(88, 86, 214, 0.08);
  border: 1px solid rgba(88, 86, 214, 0.15);
  border-radius: 8px;
  color: #5856d6;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
  white-space: nowrap;
}

.worldbook-form-import-btn:active {
  background: rgba(88, 86, 214, 0.15);
  transform: scale(0.96);
}

.worldbook-form-import-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.worldbook-form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--worldbook-text-main);
  margin-bottom: 8px;
}

.worldbook-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--worldbook-border);
  border-radius: var(--worldbook-radius-sm);
  background: #f9f9fa;
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--worldbook-text-main);
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.worldbook-input:focus {
  border-color: var(--color-accent);
}

.worldbook-input::placeholder {
  color: var(--worldbook-text-hint);
}

.worldbook-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--worldbook-border);
  border-radius: var(--worldbook-radius-sm);
  background: #f9f9fa;
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--worldbook-text-main);
  outline: none;
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.worldbook-textarea:focus {
  border-color: var(--color-accent);
}

.worldbook-textarea::placeholder {
  color: var(--worldbook-text-hint);
}

/* 分类选择行 */
.worldbook-select-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 放置位置选择行 */
.worldbook-position-row {
  display: flex;
  gap: 0;
  border-radius: var(--worldbook-radius-sm);
  overflow: hidden;
  border: 1px solid var(--worldbook-border);
}

.worldbook-position-chip {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: var(--worldbook-card-bg);
  color: var(--worldbook-text-sub);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-align: center;
  border-right: 1px solid var(--worldbook-border);
}

.worldbook-position-chip:last-child {
  border-right: none;
}

.worldbook-position-chip.active {
  background: var(--worldbook-active-bg);
  color: var(--worldbook-active-text);
}

.worldbook-position-chip:active {
  opacity: 0.7;
}

/* 表单提示文字 */
.worldbook-form-hint {
  font-size: 11px;
  color: var(--worldbook-text-hint);
  line-height: 1.5;
  margin-top: 8px;
}

/* 位置标签（卡片中展示） */
.worldbook-tag-position {
  background: #eef0ff;
  color: #4a5aba;
}

/* 绑定模式标签（通用） */
.worldbook-tag-bind {
  background: #e3f2fd;
  color: #1565c0;
}

/* 线下绑定模式提示卡片 */
.worldbook-offline-warning {
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #8c6d1f;
}
.worldbook-offline-warning p {
  margin: 0 0 4px;
}
.worldbook-offline-warning p:last-child {
  margin-bottom: 0;
}

.worldbook-tag-online {
  background: #e3f2fd;
  color: #1565c0;
}

.worldbook-tag-offline {
  background: #fce4ec;
  color: #c62828;
}

/* 挂载角色标签 */
.worldbook-tag-mount {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* 绑定模式选择行（复用 position 样式） */
.worldbook-bind-row {
  display: flex;
  gap: 0;
  border-radius: var(--worldbook-radius-sm);
  overflow: hidden;
  border: 1px solid var(--worldbook-border);
}

.worldbook-bind-chip {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: var(--worldbook-card-bg);
  color: var(--worldbook-text-sub);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-align: center;
  border-right: 1px solid var(--worldbook-border);
}

.worldbook-bind-chip:last-child {
  border-right: none;
}

.worldbook-bind-chip.active {
  background: var(--worldbook-active-bg);
  color: var(--worldbook-active-text);
}

.worldbook-bind-chip.active[data-bind="online"] {
  background: #1565c0;
}

.worldbook-bind-chip.active[data-bind="offline"] {
  background: #c62828;
}

.worldbook-bind-chip:active {
  opacity: 0.7;
}

/* 挂载角色选择器 */
.worldbook-mount-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--worldbook-border);
  border-radius: var(--worldbook-radius-sm);
  background: #f9f9fa;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.worldbook-mount-select:active {
  border-color: var(--color-accent);
}

.worldbook-mount-placeholder {
  font-size: var(--font-size-base);
  color: var(--worldbook-text-hint);
}

.worldbook-mount-placeholder.has-value {
  color: var(--worldbook-text-main);
}

.worldbook-mount-arrow {
  width: 18px;
  height: 18px;
  color: var(--worldbook-text-hint);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.worldbook-mount-select.is-open .worldbook-mount-arrow {
  transform: rotate(180deg);
}

/* 挂载角色下拉列表 */
.worldbook-mount-dropdown {
  display: none;
  margin-top: 6px;
  border: 1px solid var(--worldbook-border);
  border-radius: var(--worldbook-radius-sm);
  background: var(--worldbook-card-bg);
  max-height: 160px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.worldbook-mount-dropdown.is-open {
  display: block;
}

.worldbook-mount-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color 0.1s ease;
  border-bottom: 1px solid var(--worldbook-border);
}

.worldbook-mount-item:last-child {
  border-bottom: none;
}

.worldbook-mount-item:active {
  background: #f5f5f5;
}

.worldbook-mount-item.selected {
  background: #f0f4ff;
}

.worldbook-mount-item__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--worldbook-text-sub);
  flex-shrink: 0;
  overflow: hidden;
}

.worldbook-mount-item__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.worldbook-mount-item__name {
  font-size: var(--font-size-sm);
  color: var(--worldbook-text-main);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worldbook-mount-item__check {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
  flex-shrink: 0;
  display: none;
}

.worldbook-mount-item.selected .worldbook-mount-item__check {
  display: block;
}


.worldbook-select-chip {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--worldbook-border);
  background: var(--worldbook-card-bg);
  color: var(--worldbook-text-sub);
  font-size: 12px;
  font-weight: var(--font-weight-regular);
  font-family: var(--font-family);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.worldbook-select-chip.active {
  background: var(--worldbook-active-bg);
  color: var(--worldbook-active-text);
  border-color: var(--worldbook-active-bg);
}

.worldbook-select-chip:active {
  opacity: 0.7;
}

/* 抽屉内添加分类按钮 */
.worldbook-select-chip--add {
  border-style: dashed;
  color: var(--worldbook-text-hint);
  font-size: 15px;
  font-weight: 300;
  padding: 5px 14px;
}

.worldbook-select-chip--add:active {
  background: #f0f0f0;
  color: var(--worldbook-text-main);
}

/* 开关行 */
.worldbook-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 4px;
}

.worldbook-switch-label {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--worldbook-text-main);
}

/* iOS-like 开关 */
.worldbook-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
}

.worldbook-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.worldbook-switch__slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e0e0e0;
  border-radius: 26px;
  transition: background-color 0.25s ease;
}

.worldbook-switch__slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 2px;
  bottom: 2px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.worldbook-switch input:checked + .worldbook-switch__slider {
  background-color: #34c759;
}

.worldbook-switch input:checked + .worldbook-switch__slider::before {
  transform: translateX(18px);
}

/* 抽屉底部按钮 */
.worldbook-drawer-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px 8px;
}

.worldbook-drawer-btn {
  flex: 1;
  padding: 12px 0;
  border-radius: var(--worldbook-radius-sm);
  border: none;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.worldbook-drawer-btn:active {
  opacity: 0.7;
}

.worldbook-drawer-btn--cancel {
  background: #f0f0f0;
  color: var(--worldbook-text-main);
}

.worldbook-drawer-btn--create {
  background: var(--worldbook-active-bg);
  color: var(--worldbook-active-text);
}

/* ---- 批量操作底部栏 ---- */
.worldbook-batch-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--spacing-lg);
  padding-bottom: calc(12px + var(--safe-area-bottom, 0px));
  background: var(--worldbook-card-bg);
  border-top: 1px solid var(--worldbook-border);
  flex-shrink: 0;
}

.worldbook-page.is-editing .worldbook-batch-bar {
  display: flex;
}

/* 编辑模式下内容区底部留出空间 */
.worldbook-page.is-editing .worldbook-content {
  padding-bottom: calc(80px + var(--safe-area-bottom, 0px));
}

.worldbook-batch-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--worldbook-radius-sm);
  border: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.worldbook-batch-btn:active {
  opacity: 0.7;
}

.worldbook-batch-btn svg {
  width: 18px;
  height: 18px;
}

.worldbook-batch-btn--selectall {
  background: #f0f0f0;
  color: var(--worldbook-text-main);
}

.worldbook-batch-btn--selectall.is-all-selected {
  background: var(--worldbook-active-bg);
  color: var(--worldbook-active-text);
}

.worldbook-batch-btn--delete {
  background: #ff3b30;
  color: #ffffff;
}

.worldbook-batch-btn--delete:disabled {
  background: #ffb3b0;
  cursor: not-allowed;
}

.worldbook-batch-btn--delete em {
  font-style: normal;
}

/* 编辑模式下隐藏卡片右侧箭头 */
.worldbook-page.is-editing .worldbook-card-action {
  display: none;
}
