/* ============================================================================
 * template-interaction.css — TIB 通用交互栏样式（P1 前端组件标准化）
 * ----------------------------------------------------------------------------
 * 视觉复用 style.css 的 .xiaoyi-* 全套视觉；.tib-* 仅补布局与 currentColor
 * 适配（深色头 / 蓝色头均可直接使用，按钮继承父级文字色）。
 * 另含 ops-channel modal 记忆摘要条 .ops-ai-summary。
 * 版本戳：20260805-p1
 * ========================================================================== */

/* ==================== 按钮栏容器 ==================== */
.tib-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==================== 按钮（继承 currentColor） ==================== */
.tib-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  color: inherit; /* 适配深色头(#fff) 与蓝色头(#fff) */
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
}

.tib-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.tib-btn:active {
  transform: scale(0.96);
}

/* ==================== 弹窗（设置 / 记忆） ==================== */
.tib-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tib-modal-box {
  background: #fff;
  border-radius: 14px;
  width: 90%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  font-family: inherit;
}

.tib-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.tib-modal-title {
  font-size: 17px;
  color: #1a1a2e;
}

.tib-modal-x {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  color: #666;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.tib-modal-x:hover {
  background: #e2e2e2;
}

.tib-modal-hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: #888;
  line-height: 1.6;
}

.tib-field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.tib-input {
  width: 100%;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 14px;
  font-family: inherit;
}

.tib-modal-actions {
  text-align: right;
}

.tib-btn-cancel {
  padding: 10px 18px;
  margin-right: 8px;
  cursor: pointer;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.tib-btn-primary {
  padding: 10px 22px;
  border: none;
  cursor: pointer;
  background: #4fc3f7;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
}

.tib-btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ==================== 摘要展示框 ==================== */
.tib-summary-box {
  max-height: 220px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fafafa;
  color: #444;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  margin-bottom: 16px;
}

/* ==================== 危险操作区 ==================== */
.tib-danger-zone {
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.tib-danger-title {
  font-size: 13px;
  font-weight: 600;
  color: #c0392b;
  margin-bottom: 8px;
}

.tib-btn-danger {
  width: 100%;
  padding: 10px;
  cursor: pointer;
  border-radius: 8px;
  background: #fff;
  color: #c0392b;
  border: 1px solid #c0392b;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.2s;
}

.tib-btn-danger:hover {
  background: #fdecea;
}

/* ==================== ops-channel modal 记忆摘要条 ==================== */
.ops-ai-summary {
  padding: 8px 20px;
  background: #eef6ff;
  color: #1a4578;
  font-size: 12px;
  line-height: 1.6;
  border-bottom: 1px solid #e3eefb;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.ops-ai-summary:empty {
  display: none;
}
