/* cognitive.css — 认知引擎页（平移自 pages/cognitive/cognitive.wxss 与
 * components/live-status/live-status.wxss，rpx÷2→px）
 */

.cg-page {
  background: #F5F6FA;
  min-height: 100vh;
  box-sizing: border-box;
}

/* —— Web 控件基础（对应小程序 button/radio 原生样式） —— */
.cg-page button {
  font-family: inherit;
  border: none;
  cursor: pointer;
}
.cg-page button:disabled { opacity: 0.55; cursor: default; }
.cg-mode input[type="radio"] {
  accent-color: #534AB7;
  margin: 0 6px 0 0;
  vertical-align: middle;
}

/* Hero */
.cg-hero {
  background: #1B1B2F;
  border-radius: 10px;
  padding: 18px 16px;
  color: #FFFFFF;
  margin-bottom: 12px;
}
.cg-hero-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.cg-hero-sub { font-size: 12px; color: rgba(255,255,255,0.65); line-height: 1.6; }

/* Tabs */
.cg-tabs {
  display: flex;
  background: #FFFFFF;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 12px;
}
.cg-tab {
  flex: 1;
  text-align: center;
  font-size: 13px;
  padding: 8px 0;
  color: #8C8C8C;
  border-radius: 6px;
  cursor: pointer;
}
.cg-tab-on { background: #534AB7; color: #FFFFFF; font-weight: 600; }

/* 区块 */
.cg-section { margin-bottom: 16px; }
.cg-section-title {
  font-size: 13px; color: #534AB7; font-weight: 600;
  margin-bottom: 8px; padding-left: 4px;
}

/* 输入 */
.cg-input {
  width: 100%; box-sizing: border-box;
  background: #FFFFFF; border-radius: 8px;
  padding: 12px; font-size: 14px;
  min-height: 80px; margin-bottom: 10px;
  border: 1px solid #E8E8F0;
  font-family: inherit; outline: none; resize: vertical;
}
.cg-input:focus { border-color: #534AB7; }
.cg-input-one { min-height: 40px; }
.cg-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.cg-search-input {
  flex: 1; background: #FFFFFF; border-radius: 8px;
  padding: 10px 12px; font-size: 14px;
  border: 1px solid #E8E8F0; box-sizing: border-box;
  font-family: inherit; outline: none;
}
.cg-search-input:focus { border-color: #534AB7; }
.cg-search-btn { width: 80px !important; flex: none; }

.cg-mode-row { margin-bottom: 8px; }
.cg-mode { font-size: 13px; color: #595959; margin-right: 16px; cursor: pointer; }

/* 按钮 */
.cg-actions { display: flex; gap: 8px; margin-top: 4px; }
.cg-btn {
  font-size: 14px; border-radius: 6px;
  padding: 0 16px; line-height: 2.4;
  flex: 1; margin: 0;
}
.cg-btn-primary { background: #534AB7; color: #FFFFFF; }
.cg-btn-ghost { background: #FFFFFF; color: #534AB7; border: 1px solid #534AB7; }

/* 状态条 */
.cg-statusbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cg-tag {
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
  background: #F0F0F6; color: #595959;
}
.cg-st-cloud { background: #E6F7EB; color: #2E7D4F; }
.cg-st-deg { background: #FFF4E5; color: #B26A00; }
.cg-st-meta { background: #EEF0FA; color: #534AB7; }

/* 卡片 */
.cg-card {
  background: #FFFFFF; border-radius: 8px;
  padding: 12px; margin-bottom: 8px;
}
.cg-card-head {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
}
.cg-card-title { font-size: 13.5px; font-weight: 600; color: #1B1B2F; flex: 1; }
.cg-card-body { font-size: 13px; color: #4A4A55; line-height: 1.7; }
.cg-truncate {
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; overflow: hidden;
}
.cg-step-idx {
  width: 20px; height: 20px; border-radius: 50%;
  background: #534AB7; color: #FFF;
  font-size: 11px; display: flex; align-items: center;
  justify-content: center; flex: none;
}
.cg-score { font-size: 12px; color: #534AB7; font-weight: 600; }
.cg-card-verdict { border-left: 4px solid #534AB7; }
.cg-verdict { font-size: 13px; font-weight: 700; }
.cg-v-ok { color: #2E7D4F; }
.cg-v-warn { color: #B26A00; }
.cg-v-bad { color: #C0392B; }
.cg-falsify {
  margin-top: 6px; font-size: 12px; color: #8C8C8C;
  border-top: 1px dashed #E8E8F0; padding-top: 6px;
}
.cg-rag-ref { font-size: 12px; color: #4A4A55; padding: 3px 0; }

/* KV */
.cg-kv { display: flex; padding: 4px 0; }
.cg-k { width: 80px; font-size: 12px; color: #8C8C8C; flex: none; }
.cg-v { font-size: 12.5px; color: #1B1B2F; flex: 1; }

/* chips */
.cg-chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.cg-chip {
  font-size: 10px; padding: 2px 7px; border-radius: 10px;
  background: #F0F0F6; color: #595959;
}
.cg-chip-hb { background: #FDF0F6; color: #B04A8A; }

/* 权重条形图 */
.cg-bar-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.cg-bar-label { width: 65px; font-size: 12px; color: #4A4A55; flex: none; }
.cg-bar-track {
  flex: 1; height: 12px; background: #F0F0F6;
  border-radius: 6px; overflow: hidden;
}
.cg-bar-fill { height: 100%; border-radius: 6px; }
.cg-bar-sys1 { background: linear-gradient(90deg, #6C5CE7, #4834D4); }
.cg-bar-sys2 { background: linear-gradient(90deg, #00B894, #00946D); }
.cg-bar-sys3 { background: linear-gradient(90deg, #E17055, #D63031); }
.cg-bar-hb { background: linear-gradient(90deg, #E879A9, #C0448A); }
.cg-bar-val { width: 55px; text-align: right; font-size: 12px; color: #1B1B2F; flex: none; }
.cg-meta-line { margin-top: 7px; font-size: 11px; color: #8C8C8C; }

/* 预测日志 */
.cg-pred-head {
  display: flex; justify-content: space-between; gap: 6px;
  font-size: 12.5px; color: #1B1B2F; margin-bottom: 4px;
}
.cg-pred-err { font-size: 11px; color: #534AB7; flex: none; }
.cg-err-hot { color: #C0392B; font-weight: 700; }
.cg-pred-line { font-size: 11.5px; color: #8C8C8C; padding: 1px 0; }

/* Hebbian */
.cg-hb-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.cg-hb-pair { width: 130px; font-size: 11px; color: #4A4A55; flex: none; overflow: hidden; }

/* 提示 */
.cg-error {
  background: #FDECEA; color: #C0392B;
  border-radius: 6px; padding: 8px 12px;
  font-size: 12.5px; margin-bottom: 10px;
  word-break: break-all;
}
.cg-retry-btn {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 14px;
  font-size: 12px;
  background: #534AB7;
  color: #FFFFFF;
  border-radius: 6px;
}
.cg-ok-msg {
  background: #E6F7EB; color: #2E7D4F;
  border-radius: 6px; padding: 8px 12px;
  font-size: 12.5px; margin-top: 8px;
}
.cg-empty {
  text-align: center; color: #B0B0BC; font-size: 12.5px;
  padding: 16px 0;
}

/* ================================================================
   内容实时状态条（平移自 components/live-status/live-status.wxss）
   ================================================================ */
.live-status {
  margin: 8px 10px;
  padding: 8px 10px;
  background: rgba(31, 56, 100, 0.06);
  border: 1px solid rgba(31, 56, 100, 0.18);
  border-radius: 7px;
  font-size: 12px;
  color: #444;
  cursor: pointer;
}
.ls-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.ls-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  background: #999;
  flex: none;
}
.ls-dot-cloud { background: #2e7d32; }
.ls-dot-local { background: #b26a00; }
.ls-title {
  font-weight: 600;
  margin-right: 6px;
  color: #1f3864;
}
.ls-source {
  color: #666;
  margin-right: 6px;
}
.ls-time {
  color: #999;
}
.ls-summary {
  margin-top: 5px;
  line-height: 1.6;
  color: #333;
}
.ls-detail {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #666;
  font-size: 11px;
}
.ls-hint {
  margin-top: 4px;
  color: #aaa;
  font-size: 10px;
}
.ls-loading { opacity: 0.75; }

/* —— Web 专属：toast —— */
#cg-toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(27, 27, 47, 0.88);
  color: #FFFFFF;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 999;
  max-width: 80vw;
}
#cg-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* v2 大脑洞察增强 */
.cg-btn-row { display: flex; gap: 8px; margin-top: 8px; }
.cg-btn-row .cg-btn { flex: 1; }
.cg-bar-prec { background: linear-gradient(90deg, #7B8FE0, #534AB7); }
.cg-ok { color: #1E8E5A; font-weight: 700; }
.cg-kv .cg-v .cg-ok { margin-left: 4px; }
.cg-pred-line b { color: #534AB7; }
