/* modals.css — story 专用弹窗子样式（环境/角色/格式选择/颜色选择等） */
/* BEM 核心弹窗样式已移至 /assets/css/modals.css — 全项目统一 */

/* 环境标签弹窗 */
.env-modal__section {
  margin-bottom: var(--sp-4);
}

.env-modal__row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.env-modal__label {
  font-size: var(--fs-small);
  color: var(--text-2);
  font-weight: var(--fw-medium);
  flex-shrink: 0;
}

.env-modal__section > .env-modal__label {
  margin-bottom: var(--sp-2);
}

.env-modal__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-left: auto;
}

.env-modal__opt {
  padding: 3px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  color: var(--text-1);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.env-modal__opt:hover {
  background: var(--bg-3);
}

.env-modal__opt--selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* 战斗弹窗标签按钮（与待办 status-tag-btn 风格一致） */
.env-modal__options--battle .env-modal__opt {
  padding: 4px 12px;
  border: none;
  border-radius: 16px;
  background: #F2F3F5;
  color: #646a73;
  font-size: 13px;
  transition: all 0.2s;
}

.env-modal__options--battle .env-modal__opt:hover {
  color: var(--primary);
  background: #F2F3F5;
}

.env-modal__options--battle .env-modal__opt--selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.env-modal__custom-input {
  width: 100%;
  height: 36px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  color: var(--text-1);
  outline: none;
  transition: border-color var(--transition-fast);
}

.env-modal__custom-input::placeholder {
  color: var(--text-4);
}

.env-modal__custom-input:focus {
  border-color: var(--primary);
}

textarea.env-modal__custom-input {
  padding-top: 6px;
  padding-bottom: 6px;
}

/* env-tag 块删除按钮 */
.env-tag__delete {
  order: 999;
  flex-shrink: 0;
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--text-4);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  line-height: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.env-tag__delete:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* 玩法块删除按钮 */
.gameplay__delete {
  order: 999;
  flex-shrink: 0;
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--text-4);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  line-height: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.gameplay__delete:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* 战斗块删除按钮 */
.battle__delete {
  order: 999;
  flex-shrink: 0;
  margin-left: auto;
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--text-4);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  line-height: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.battle__delete:hover {
  background: var(--danger-light);
  color: var(--danger);
}
.role-modal__field {
  margin-bottom: var(--sp-3);
}

.role-modal__label {
  font-size: var(--fs-small);
  color: var(--text-2);
  margin-bottom: var(--sp-1);
  font-weight: var(--fw-medium);
}

.role-modal__input {
  width: 100%;
  height: 36px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  color: var(--text-1);
  outline: none;
  transition: border-color var(--transition-fast);
}

.role-modal__input:focus {
  border-color: var(--primary);
}

.role-modal__input--error {
  border-color: var(--danger);
}

.role-modal__error {
  font-size: var(--fs-tiny);
  color: var(--danger);
  margin-top: var(--sp-1);
}

.role-modal__color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-2);
}

.role-modal__color-opt {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.role-modal__color-opt--selected {
  border-color: var(--text-1);
}

/* 格式选择弹窗 */
.format-modal__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.format-modal__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.format-modal__item:hover {
  background: var(--bg-2);
}

.format-modal__item-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-2);
}

.format-modal__item-label {
  font-size: var(--fs-small);
  color: var(--text-1);
}

/* Toast 轻提示 */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  background: var(--text-1);
  color: var(--bg-1);
  border-radius: var(--radius-md);
  font-size: var(--fs-small);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  animation: toastIn 200ms ease-out;
  pointer-events: auto;
  max-width: 400px;
}

.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }
.toast--warning { background: #fa8c16; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast--leaving {
  animation: toastOut 150ms ease-in forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* Tooltip */
.tooltip {
  position: fixed;
  z-index: 500;
  padding: 4px 8px;
  background: var(--text-1);
  color: var(--bg-1);
  font-size: var(--fs-tiny);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
  animation: tooltipIn 100ms ease-out;
}

@keyframes tooltipIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 搜索浮层 */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm);
  z-index: 250;
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
  gap: var(--sp-2);
  animation: searchIn 200ms ease;
}

@keyframes searchIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-overlay__input {
  flex: 1;
  height: 36px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body);
  color: var(--text-1);
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-overlay__input:focus {
  border-color: var(--primary);
}

.search-overlay__btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  transition: background var(--transition-fast);
}

.search-overlay__btn:hover {
  background: var(--bg-3);
  color: var(--text-1);
}

.search-overlay__count {
  font-size: var(--fs-small);
  color: var(--text-3);
  white-space: nowrap;
}

.search-overlay mark {
  background: rgba(51, 112, 255, 0.25);
  color: inherit;
  border-radius: 2px;
}

.search-overlay mark--current {
  background: var(--primary);
  color: var(--bg-1);
}

/* ===== 灵感/日记详情内部样式（保留）===== */
.note-detail-body { padding: 0 20px; max-height: 60vh; overflow-y: auto; }
.note-detail-time { font-size: 12px; color: var(--text-3); margin-top: 6px; font-weight: 400; }
.note-detail-field { margin-bottom: 16px; }
.note-detail-field:last-child { margin-bottom: 0; }
.note-detail-field > label { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 4px; padding: 4px 8px; background: #F2F3F5; border-radius: 4px; }
.note-detail-field > .note-detail-value { font-size: 14px; color: #333; line-height: 1.6; word-break: break-word; }
.note-detail-value.note-detail-content { white-space: pre-wrap; }

/* ===== 保存到飞书弹窗 - 文件夹树 ===== */
.save-feishu-folder-item {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 8px;
  margin: 0 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}
.save-feishu-folder-item:hover {
  background: #f2f3f5;
}
.save-feishu-folder-item.selected {
  background: #e8f0fe;
}

.save-feishu-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #646a73;
  opacity: 0.4;
  transition: transform 0.15s, opacity 0.15s;
  margin-right: 2px;
}
.save-feishu-folder-item.expanded > .save-feishu-arrow {
  transform: rotate(90deg);
  opacity: 1;
}

.save-feishu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #646a73;
  margin-right: 6px;
}

.save-feishu-label {
  font-size: 14px;
  color: #1f2329;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.save-feishu-tree-children {
  display: none;
}

/* ===== 底部弹框（用户菜单手机端） ===== */
/* 使用 #mobile-view-container ID 选择器，避免与 workspace 的 .mobile-view-container 冲突 */
#mobile-view-container {
  display: none;
}
@media (max-width: 1024px) {
  #mobile-view-container {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
  }
}

.file-action-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.file-action-sheet-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.file-action-sheet {
  width: 100%;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px 0 28px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.file-action-sheet-overlay.show .file-action-sheet {
  transform: translateY(0);
}
.file-action-list {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.file-action-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 24px;
  cursor: pointer;
  color: #333;
  font-size: 15px;
  gap: 14px;
}
.file-action-item:active { background: #f5f5f5; }
.file-action-item.danger { color: #e53935; }
.file-action-item .file-action-label { text-align: left; }

/* ===== 选项分支弹窗 ===== */
.choice-modal__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-bottom: var(--sp-5);
}

.choice-modal__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.choice-modal__label {
  width: 52px;
  flex-shrink: 0;
  font-size: var(--fs-body);
  color: var(--text-1);
  line-height: 1;
}

.choice-modal__input-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}

.choice-modal__input {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 var(--sp-3);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body);
  color: var(--text-1);
  background: var(--bg-1);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition-fast);
}

.choice-modal__input::placeholder {
  color: var(--text-4);
  font-size: var(--fs-small);
}

.choice-modal__input:focus {
  border-color: var(--primary);
}

.choice-modal__delete {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-3);
  flex-shrink: 0;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.choice-modal__delete:hover {
  color: var(--danger);
  background: var(--bg-2);
}

.choice-modal__delete--hidden {
  visibility: hidden;
  pointer-events: none;
}

.choice-modal__add-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.choice-modal__add-btn svg,
.choice-modal__delete svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
