/* ==========================================================================
   NOTHING 成果引擎 v1 · 视觉层（2026-09-15）
   目标：把「干巴巴的一坨文字」升级成有科技感、可预览、可下载的成果件。
   主题：全部走 style.css 已定义的 CSS 变量，light / dark 两套自动适配。
   ========================================================================== */

:root {
  --nt-a1: #4a7dff;
  --nt-a2: #7a3cff;
  --nt-a3: #00c2a8;
  --nt-glow: rgba(74, 125, 255, .22);
  --nt-line: rgba(74, 125, 255, .30);
  --nt-grid: rgba(13, 13, 14, .05);
}
[data-theme="dark"] {
  --nt-glow: rgba(96, 150, 255, .30);
  --nt-line: rgba(96, 150, 255, .38);
  --nt-grid: rgba(255, 255, 255, .045);
}

/* ---------- 对话区底纹：已移除格子纹理（K.JDEX 2026-09-16 要求纯色桌面） ---------- */
#chatMessages {
  background-image: none;
}

/* ---------- AI 气泡：细描边 + 微光 ---------- */
.msg-ai .msg-bubble {
  position: relative;
  border: 1px solid var(--border-light, rgba(13, 13, 14, .09));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 8px 26px -14px var(--nt-glow);
  overflow: hidden;
}
.msg-ai .msg-bubble::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--nt-a1), var(--nt-a2) 55%, var(--nt-a3));
  opacity: .85;
}

/* ---------- 数据卡：分屏「图 ｜ 表」 ---------- */
.nt-card {
  margin: 12px 0;
  border: 1px solid var(--border, rgba(13, 13, 14, .14));
  border-radius: 14px;
  background: var(--card, #fff);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .04), 0 14px 40px -26px var(--nt-glow);
  overflow: hidden;
}
.nt-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light, rgba(13, 13, 14, .09));
  background: linear-gradient(90deg, rgba(74, 125, 255, .07), transparent 70%);
}
.nt-chip {
  font: 600 10px/1 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  padding: 4px 7px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--nt-a1), var(--nt-a2));
  box-shadow: 0 2px 8px -2px var(--nt-glow);
  white-space: nowrap;
}
.nt-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #5a5a55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nt-seg { display: flex; gap: 3px; flex: 0 0 auto; }
.nt-seg button {
  font: 500 11px/1 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  padding: 5px 9px;
  border: 1px solid var(--border, rgba(13, 13, 14, .14));
  border-radius: 6px;
  background: var(--bg-card, #fff);
  color: var(--text-muted, #7a7a76);
  cursor: pointer;
  transition: all .16s;
}
.nt-seg button:hover { border-color: var(--nt-line); color: var(--nt-a1); }
.nt-seg button.on {
  background: linear-gradient(135deg, var(--nt-a1), var(--nt-a2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px -3px var(--nt-glow);
}

.nt-split { display: grid; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .nt-split.nt-two { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .nt-split.nt-two .nt-pane-table { border-left: 1px solid var(--border-light, rgba(13,13,14,.09)); }
}
.nt-pane { min-width: 0; overflow: auto; }
.nt-chart { width: 100%; height: 240px; }
.nt-pane-table .md-table-wrap { margin: 0; }
.nt-hide { display: none !important; }

/* 表格在卡内更紧凑 */
.nt-card .md-table { font-size: 12.5px; }
.nt-card .md-table th { background: var(--bg-soft, #ecebe5); font-weight: 600; }

/* ---------- 流程图 ---------- */
.nt-mermaid {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--border-light, rgba(13, 13, 14, .09));
  border-radius: 12px;
  background: var(--card, #fff);
  overflow: auto;
  text-align: center;
}
.nt-mermaid svg { max-width: 100%; height: auto; }

/* ---------- 成果工具条 ---------- */
.nt-arti {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px;
  padding: 7px 9px;
  border: 1px dashed var(--border, rgba(13, 13, 14, .14));
  border-radius: 11px;
  background: linear-gradient(120deg, rgba(74, 125, 255, .05), rgba(0, 194, 168, .05));
}
.nt-arti-label {
  font: 600 10px/1 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: .14em;
  color: var(--text-muted, #7a7a76);
  text-transform: uppercase;
  margin-right: 2px;
}
.nt-arti button {
  font: 500 12px/1 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border: 1px solid var(--border, rgba(13, 13, 14, .14));
  border-radius: 999px;
  background: var(--bg-card, #fff);
  color: var(--text, #0d0d0e);
  cursor: pointer;
  transition: all .16s;
}
.nt-arti button:hover {
  border-color: var(--nt-line);
  color: var(--nt-a1);
  box-shadow: 0 4px 16px -6px var(--nt-glow);
  transform: translateY(-1px);
}
.nt-arti button.nt-primary {
  background: linear-gradient(135deg, var(--nt-a1), var(--nt-a2));
  border-color: transparent;
  color: #fff;
}
.nt-arti button.nt-primary:hover { color: #fff; box-shadow: 0 6px 20px -6px var(--nt-glow); }
.nt-arti button[disabled] { opacity: .5; cursor: default; transform: none; }

/* ---------- 全屏成果预览 ---------- */
.nt-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  background: rgba(8, 9, 14, .72);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: nt-fade .18s ease;
}
@keyframes nt-fade { from { opacity: 0 } to { opacity: 1 } }
.nt-ov-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(16, 18, 27, .96);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  color: #e8eaef;
}
.nt-ov-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nt-ov-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.nt-ov-actions button {
  font: 500 12px/1 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: #e8eaef;
  cursor: pointer;
  transition: all .16s;
}
.nt-ov-actions button:hover { background: rgba(255, 255, 255, .16); }
.nt-ov-actions button.nt-primary {
  background: linear-gradient(135deg, var(--nt-a1), var(--nt-a2));
  border-color: transparent;
  color: #fff;
}
.nt-ov-frame {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: #fff;
}

/* 移动端：工具条不挤 */
@media (max-width: 600px) {
  .nt-arti button { padding: 6px 9px; font-size: 11.5px; }
  .nt-chart { height: 200px; }
  .nt-ov-title { font-size: 12px; }
  .nt-ov-actions button { padding: 7px 9px; font-size: 11.5px; }
}

/* 图表占位/降级提示 */
.nt-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 90px;
  font: 500 12px/1 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text-muted, #7a7a76);
  letter-spacing: .04em;
}
