/* ========== char-import.css ========== */
/* 角色导入弹窗 — 灰白简约 / SVG 线条 */

.ci-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .22s ease;
  padding: 20px;
  box-sizing: border-box;
}
.ci-overlay.active { opacity: 1; }

.ci-modal {
  width: 100%;
  max-width: 380px;
  background: #f5f5f7;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .06);
  overflow: hidden;
  transform: translateY(12px) scale(.98);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  display: flex;
  flex-direction: column;
  max-height: 88vh;
}
.ci-overlay.active .ci-modal {
  transform: translateY(0) scale(1);
}

.ci-modal-header {
  padding: 18px 20px 14px;
  border-bottom: .5px solid rgba(0, 0, 0, .06);
  flex-shrink: 0;
}
.ci-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -.2px;
  text-align: center;
}

.ci-modal-body {
  padding: 18px 20px 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

/* ── 文件选择区 ── */
.ci-file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 16px;
  border: 1.5px dashed rgba(0, 0, 0, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .55);
  cursor: pointer;
  text-align: center;
  transition: background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.ci-file-drop:active {
  background: rgba(255, 255, 255, .85);
  border-color: rgba(0, 0, 0, .22);
}
.ci-file-drop svg {
  width: 26px;
  height: 26px;
  stroke: #a8a8ad;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ci-file-drop-title {
  font-size: 14px;
  font-weight: 600;
  color: #3a3a3c;
  letter-spacing: -.1px;
}
.ci-file-drop-sub {
  font-size: 11.5px;
  color: #a0a0a5;
  font-weight: 400;
}

/* ── 已选文件 ── */
.ci-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 12px;
}
.ci-file-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ci-file-icon svg {
  width: 16px;
  height: 16px;
  stroke: #6e6e73;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ci-file-meta {
  flex: 1;
  min-width: 0;
}
.ci-file-name {
  font-size: 13.5px;
  font-weight: 500;
  color: #1d1d1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.ci-file-size {
  font-size: 11px;
  color: #a0a0a5;
  margin-top: 2px;
}
.ci-file-clear {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
}
.ci-file-clear:active { background: rgba(0, 0, 0, .12); }
.ci-file-clear svg {
  width: 10px;
  height: 10px;
  stroke: #6e6e73;
}

/* ── 状态提示 ── */
.ci-status {
  margin-top: 12px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 10px;
  line-height: 1.4;
  text-align: center;
  background: rgba(0, 0, 0, .04);
  color: #6e6e73;
}
.ci-status-error {
  background: rgba(255, 59, 48, .08);
  color: #b5332b;
}
.ci-status-success {
  background: rgba(52, 199, 89, .1);
  color: #1a7a34;
}

/* ── 底部按钮 ── */
.ci-modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px calc(env(safe-area-inset-bottom, 4px) + 14px);
  border-top: .5px solid rgba(0, 0, 0, .06);
  flex-shrink: 0;
}

.ci-btn {
  height: 42px;
  border-radius: 11px;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .12s, background .12s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -.1px;
  padding: 0 12px;
  white-space: nowrap;
}
.ci-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.ci-btn:active:not(:disabled) { opacity: .82; }

.ci-btn-ghost {
  flex: 1;
  background: rgba(255, 255, 255, .65);
  color: #6e6e73;
  border: 1px solid rgba(0, 0, 0, .08);
}
.ci-btn-ghost:active:not(:disabled) { background: rgba(255, 255, 255, .9); }

.ci-btn-secondary {
  flex: 1.15;
  background: rgba(0, 0, 0, .06);
  color: #3a3a3c;
}
.ci-btn-secondary:active:not(:disabled) { background: rgba(0, 0, 0, .1); }

.ci-btn-primary {
  flex: 1.35;
  background: #3a3a3c;
  color: #fff;
}
.ci-btn-primary:active:not(:disabled) { opacity: .82; }

/* ═══════════════════════════════════════
   二级菜单（仅解析 / 解析并补全）
   ═══════════════════════════════════════ */
.ci-submenu-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .22);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .2s ease;
  padding: 20px;
  box-sizing: border-box;
}
.ci-submenu-overlay.active { opacity: 1; }

.ci-submenu {
  width: 100%;
  max-width: 320px;
  background: #f5f5f7;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .06);
  overflow: hidden;
  transform: translateY(10px) scale(.98);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.ci-submenu-overlay.active .ci-submenu {
  transform: translateY(0) scale(1);
}

.ci-submenu-title {
  padding: 16px 20px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #8e8e93;
  letter-spacing: .3px;
  text-align: center;
}

.ci-submenu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
  border-top: .5px solid rgba(0, 0, 0, .05);
}
.ci-submenu-item:active { background: rgba(0, 0, 0, .04); }

.ci-submenu-item svg {
  width: 22px;
  height: 22px;
  stroke: #6e6e73;
  flex-shrink: 0;
}

.ci-submenu-item-text {
  flex: 1;
  min-width: 0;
}
.ci-submenu-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -.1px;
}
.ci-submenu-item-sub {
  font-size: 11.5px;
  color: #a0a0a5;
  margin-top: 2px;
}

.ci-submenu-cancel {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6e6e73;
  font-family: inherit;
  border-top: .5px solid rgba(0, 0, 0, .05);
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
}
.ci-submenu-cancel:active { background: rgba(0, 0, 0, .04); }

/* ═══════════════════════════════════════
   世界书「条目」小标题 + 添加按钮
   ═══════════════════════════════════════ */
.wb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 6px;
}

.wb-add-entry-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .75);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06), 0 0 0 .5px rgba(0, 0, 0, .06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, transform .15s;
  padding: 0;
}
.wb-add-entry-btn:active {
  background: rgba(255, 255, 255, .98);
  transform: scale(.92);
}
.wb-add-entry-btn svg {
  width: 13px;
  height: 13px;
  stroke: #3a3a3c;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
  display: block;
}