/* ═══════════════ Chat2BI 共通样式 ═══════════════ */

/* ═══ 全局按钮：对齐设计原型 Btn（默认=白底1.5px描边深字 / primary=蓝底白字 / error=浅红底红字 / 圆角8 / 字重600 / 禁用=半透明）═══ */
.ivu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;   /* 固定高度，边框不撑外高：同尺寸按钮(无论有无边框)严格等高 */
  height: 37px;
  line-height: 1;
  padding: 0 20px;
  border: 1.5px solid #e8ecf1;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
  transition: all .15s;
}
.ivu-btn:hover,
.ivu-btn:focus {
  border-color: #c3c8d0;
  background: #fafbfc;
  color: #111827;
}
.ivu-btn-small { height: 30px; padding: 0 14px; font-size: 12px; }
.ivu-btn-large { height: 44px; padding: 0 24px; font-size: 14px; }

/* primary：蓝底白字（原型 primary 无边框，故去边框，避免比原型高/宽 3px）*/
.ivu-btn-primary,
.ivu-btn-primary.ivu-btn-ghost {
  background: #2563eb; color: #fff; border: none;
}
.ivu-btn-primary:hover,
.ivu-btn-primary:focus {
  background: #1d4fd8; color: #fff; border: none;
}

/* error/删除：浅红底红字、无边框 */
.ivu-btn-error,
.ivu-btn-error.ivu-btn-ghost {
  background: #fef2f2; color: #dc2626; border: none;
}
.ivu-btn-error:hover,
.ivu-btn-error:focus {
  background: #fde4e4; color: #dc2626; border: none;
}

/* warning = 下线（中性"停用"，石板灰，不用警示色）；success = 上线（正向"激活"，翠绿）；均无边框 */
.ivu-btn-warning,
.ivu-btn-warning.ivu-btn-ghost {
  background: #f1f5f9; color: #64748b; border: none;
}
.ivu-btn-warning:hover { background: #e2e8f0; color: #64748b; }
.ivu-btn-success,
.ivu-btn-success.ivu-btn-ghost {
  background: #ecfdf5; color: #059669; border: none;
}
.ivu-btn-success:hover { background: #d1fae5; color: #059669; }

/* 默认 ghost 回落为白底描边 */
.ivu-btn-default.ivu-btn-ghost {
  background: #fff; color: #111827; border-color: #e8ecf1;
}

/* 禁用：原型用半透明（覆盖 iView 灰底） */
.ivu-btn.ivu-btn-disabled,
.ivu-btn[disabled] { opacity: .5; }
.ivu-btn-primary[disabled],
.ivu-btn-primary.ivu-btn-disabled {
  background: #2563eb !important; color: #fff !important; border-color: #2563eb !important;
}
.ivu-btn-default[disabled],
.ivu-btn-default.ivu-btn-disabled {
  background: #fff !important; color: #111827 !important; border-color: #e8ecf1 !important;
}

/* 气泡确认(Poptip confirm)底部按钮：取消(text型)与确定(primary)统一大小与风格，避免取消小一号 */
.ivu-poptip-footer .ivu-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 32px !important;
  min-width: 64px;
  padding: 0 18px !important;
  font-size: 13px !important;
  font-weight: 600;
  border-radius: 8px;
  line-height: 1;
}
.ivu-poptip-footer .ivu-btn-text {
  background: #fff;
  border: 1.5px solid #e8ecf1;
  color: #515a6e;
}
.ivu-poptip-footer .ivu-btn-text:hover {
  border-color: #c3c8d0;
  background: #fafbfc;
  color: #2d3340;
}
/* 确定(primary)在气泡里改为浅蓝描边(不那么实)，与白底取消观感更均衡；hover 才填实蓝 */
.ivu-poptip-footer .ivu-btn-primary {
  background: #eef3ff;
  border: 1.5px solid #d6e2ff;
  color: #2563eb;
}
.ivu-poptip-footer .ivu-btn-primary:hover,
.ivu-poptip-footer .ivu-btn-primary:focus {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

/* ---- 间距：margin ---- */
.mb-2  { margin-bottom: 2px; }
.mb-4  { margin-bottom: 4px; }
.mb-6  { margin-bottom: 6px; }
.mb-8  { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.mt-2  { margin-top: 2px; }
.mt-3  { margin-top: 3px; }
.mt-4  { margin-top: 4px; }
.mt-6  { margin-top: 6px; }
.mt-8  { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }

/* ---- 间距：padding ---- */
.pt-12 { padding-top: 12px; }

/* ---- Flex 布局 ---- */
.flex-row         { display: flex; }
.flex-col         { display: flex; flex-direction: column; }
.flex-center      { display: flex; align-items: center; justify-content: center; }
.flex-center-v    { display: flex; align-items: center; }
.flex-spread      { display: flex; align-items: center; justify-content: space-between; }
.flex-start       { display: flex; align-items: flex-start; }
.flex-wrap        { flex-wrap: wrap; }

.gap-3  { gap: 3px; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.flex-1       { flex: 1; }
.flex-shrink0 { flex-shrink: 0; }

/* ---- 文字 ---- */
.text-xs       { font-size: 11px; }
.text-sm       { font-size: 12px; }
.text-base     { font-size: 13px; }
.text-md       { font-size: 14px; }
.text-lg       { font-size: 15px; }

.fw-400 { font-weight: 400; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.c-text    { color: #111827; }
.c-sub     { color: #6b7280; }
.c-hint    { color: #9ca3af; }
.c-blue    { color: #2563eb; }
.c-blue-d  { color: #1e40af; }
.c-green   { color: #16a34a; }
.c-green-d { color: #166534; }
.c-amber-d { color: #92400e; }
.c-red     { color: #dc2626; }
.c-purple  { color: #7c3aed; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 4px;
}

.page-title {
  font-size: 18px;
  font-weight: 800;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
}

/* ---- 背景 ---- */
.bg-white    { background: #fff; }
.bg-page     { background: #f8f9fb; }
.bg-light    { background: #f3f4f6; }
.bg-blue-l   { background: #eff4ff; }
.bg-green-l  { background: #f0fdf4; }
.bg-amber-l  { background: #fffbeb; }
.bg-red-l    { background: #fef2f2; }
.bg-coral-l  { background: #fff7ed; }
.bg-purple-l { background: #f3f0ff; }

/* ---- 边框 ---- */
.bd          { border: 1px solid #e8ecf1; }
.bd-t        { border-top: 1px solid #e8ecf1; }
.bd-b        { border-bottom: 1px solid #e8ecf1; }

/* ---- 圆角 ---- */
.r-4  { border-radius: 4px; }
.r-6  { border-radius: 6px; }
.r-8  { border-radius: 8px; }
.r-10 { border-radius: 10px; }
.r-12 { border-radius: 12px; }
.r-16 { border-radius: 16px; }
.r-20 { border-radius: 20px; }
.r-full { border-radius: 50%; }

/* ---- 文字工具 ---- */
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-center { text-align: center; }
.text-right  { text-align: right; }
.nowrap      { white-space: nowrap; }

/* ---- 尺寸工具 ---- */
.w-full   { width: 100%; }
.min-w-0  { min-width: 0; }

/* ---- 光标 ---- */
.pointer { cursor: pointer; }

/* ---- 溢出 ---- */
.overflow-auto   { overflow: auto; }
.overflow-hidden { overflow: hidden; }

/* ---- 栅格 ---- */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- 遮罩 ---- */
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- 表单原生控件 ---- */
.textarea-base {
  font-family: inherit;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1.5px solid #e8ecf1;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  resize: vertical;
}

/* ---- 按钮行：右对齐 ---- */
.btn-row { display: flex; gap: 8px; justify-content: flex-end; }

/* ---- 副描述文本 ---- */
.sub-desc { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* ---- grid/表格 表头单元格文字 ---- */
.grid-head-cell { font-size: 11px; font-weight: 700; color: #6b7280; }

/* ---- 等宽字体小号 ---- */
.mono { font-family: monospace; font-size: 12px; }

/* ---- 卡片标题 / 副标题 ---- */
.card-title   { font-size: 14px; font-weight: 700; }
.card-subtitle { font-size: 12px; color: #6b7280; }

/* ---- 图标方块容器（尺寸/圆角/背景在元素上补） ---- */
.icon-box { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---- 弹层 ---- */
.modal-panel  { background: #fff; border-radius: 12px; padding: 22px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title  { font-size: 16px; font-weight: 700; }
.close-icon   { cursor: pointer; color: #6b7280; }

/* ---- 代码标签（表名/字段名内联） ---- */
.code-tag { font-family: monospace; font-size: 12px; color: #6b7280; background: #f3f4f6; padding: 2px 8px; border-radius: 4px; }

/* ---- 空状态提示 ---- */
.empty-hint { text-align: center; padding: 30px; color: #6b7280; font-size: 13px; }

/* ---- 必填星号 ---- */
.required-star { color: #dc2626; }

/* ---- 表单字段标题（深色，弹层/详情用） ---- */
.form-label-dark { font-size: 12px; color: #333; margin-bottom: 4px; }

/* ---- 标签输入框（近义词/敏感词/Tag） ---- */
.tag-input-box { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-radius: 8px; border: 1.5px solid #e8ecf1; min-height: 36px; align-items: center; }
.naked-input   { font-family: inherit; border: none; outline: none; font-size: 12px; flex: 1; min-width: 60px; padding: 2px 0; background: transparent; }

/* ---- SQL 暗色编辑器 ---- */
.textarea-dark {
  font-family: monospace; width: 100%; padding: 10px; border-radius: 8px;
  border: 1.5px solid #e8ecf1; font-size: 12px; background: #1e293b; color: #e2e8f0;
  outline: none; box-sizing: border-box; resize: vertical; line-height: 1.7;
}

/* ---- 旋转动画 ---- */
.spin { animation: c2b-spin 1s linear infinite; }
@keyframes c2b-spin { to { transform: rotate(360deg); } }

/* ---- 响应式 ---- */
@media (max-width: 720px) {
  .hidden-mobile { display: none; }
}
