/* ============================================
   Agent 三维架构图（首页 #agent3d）
   ============================================ */
.agent3d {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0;
  background: linear-gradient(150deg, #1d2f24 0%, #16241c 55%, #1a2620 100%);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 18px 0 rgba(53, 84, 63, .07), 0 2px 0 rgba(0, 0, 0, .04);
  border: 1.5px solid rgba(53, 84, 63, .28);
  /* 固定高度：右栏详情在内部滚动，左侧 3D 舞台始终保持合理比例，
     避免详情内容把 grid 撑高、导致三维模型被压扁或偏出可视区 */
  height: 660px;
}

/* 舞台：3D 画布 */
.agent3d-stage {
  position: relative;
  min-height: 0;
  min-width: 0;
  background:
    radial-gradient(ellipse 62% 52% at 50% 48%, rgba(126, 200, 160, .16), transparent 72%),
    radial-gradient(ellipse 90% 70% at 78% 12%, rgba(179, 72, 95, .10), transparent 66%);
}
.agent3d-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block; cursor: grab;
  touch-action: none;
}
.agent3d-canvas.is-dragging { cursor: grabbing; }

/* 舞台上角提示 */
.agent3d-hint {
  position: absolute; left: 18px; top: 15px; z-index: 3;
  font-size: 11.5px; letter-spacing: .4px;
  color: rgba(226, 238, 228, .55);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px; padding: 5px 13px;
  backdrop-filter: blur(4px);
  pointer-events: none; user-select: none;
}

/* 舞台右下：当前选中层的浮标 */
.agent3d-badge {
  position: absolute; right: 18px; bottom: 16px; z-index: 3;
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; font-weight: 700; color: #eaf4ec;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px; padding: 9px 15px;
  backdrop-filter: blur(6px);
  pointer-events: none; user-select: none;
  opacity: 0; transform: translateY(8px);
  transition: opacity .28s, transform .28s;
}
.agent3d-badge.on { opacity: 1; transform: translateY(0); }
.agent3d-badge i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--dot, #7ec8a0);
  box-shadow: 0 0 10px var(--dot, #7ec8a0);
  flex: none;
}

/* 右侧：详情面板 */
.agent3d-panel {
  position: relative; z-index: 2;
  padding: 34px 36px 34px 30px;
  display: flex; flex-direction: column;
  border-left: 1.5px solid rgba(255, 255, 255, .09);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012));
  min-width: 0; min-height: 0;
  overflow: hidden;
}
.agent3d-kicker {
  font-size: 11.5px; font-weight: 800; letter-spacing: 1.6px;
  color: #8fd3ac; text-transform: uppercase; margin-bottom: 9px;
}
.agent3d-title {
  font-family: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif;
  font-size: 25px; color: #f2f8f3; margin: 0 0 8px; line-height: 1.4;
}
.agent3d-sub {
  font-size: 13.5px; color: rgba(219, 235, 223, .62);
  line-height: 1.75; margin: 0 0 22px;
}

/* 层选择列表 */
.agent3d-layers { display: flex; flex-direction: column; gap: 7px; margin-bottom: 22px; }
.agent3d-layer {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 15px; border-radius: 11px; cursor: pointer;
  background: rgba(255, 255, 255, .045);
  border: 1.5px solid rgba(255, 255, 255, .075);
  transition: background .2s, border-color .2s, transform .2s;
  text-align: left; width: 100%; font: inherit; color: inherit;
}
.agent3d-layer:hover { background: rgba(255, 255, 255, .085); transform: translateX(3px); }
.agent3d-layer.on {
  background: var(--tint, rgba(126, 200, 160, .17));
  border-color: var(--dot, #7ec8a0);
}
.agent3d-layer-dot {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
  background: var(--dot, #7ec8a0);
  box-shadow: 0 0 10px var(--dot, #7ec8a0);
  transition: transform .2s;
}
.agent3d-layer.on .agent3d-layer-dot { transform: scale(1.28); }
.agent3d-layer-name { font-size: 14px; font-weight: 800; color: #eef6f0; flex: none; }
.agent3d-layer-role {
  font-size: 12px; color: rgba(219, 235, 223, .5);
  margin-left: auto; text-align: right; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.agent3d-layer.on .agent3d-layer-role { color: rgba(240, 250, 243, .78); }

/* 详情内容 */
.agent3d-detail {
  flex: 1; min-height: 0;
  border-top: 1.5px dashed rgba(255, 255, 255, .13);
  padding-top: 20px;
  display: flex; flex-direction: column;
  /* 内容超出时在此区域内部滚动，不影响外层 grid 高度 */
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  margin-right: -6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 200, 160, .32) transparent;
}
.agent3d-detail::-webkit-scrollbar { width: 5px; }
.agent3d-detail::-webkit-scrollbar-track { background: transparent; }
.agent3d-detail::-webkit-scrollbar-thumb {
  background: rgba(126, 200, 160, .28); border-radius: 999px;
}
.agent3d-detail::-webkit-scrollbar-thumb:hover { background: rgba(126, 200, 160, .48); }
.agent3d-detail-name {
  font-size: 17px; font-weight: 900; color: #f2f8f3;
  margin: 0 0 7px; display: flex; align-items: center; gap: 9px;
}
.agent3d-detail-name::before {
  content: ""; width: 4px; height: 17px; border-radius: 999px;
  background: var(--dot, #7ec8a0); flex: none;
}
.agent3d-detail-desc {
  font-size: 13.5px; line-height: 1.8;
  color: rgba(219, 235, 223, .68); margin: 0 0 15px;
}
.agent3d-detail-label {
  font-size: 11.5px; font-weight: 800; letter-spacing: 1.1px;
  color: rgba(143, 211, 172, .8); margin-bottom: 9px;
}

/* 小标题（术语 / 核心 / 继续深挖） */
.agent3d-subhead {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 1.1px;
  color: rgba(143, 211, 172, .8); margin: 0 0 10px;
}
.agent3d-subhead.is-sub { margin-top: 16px; color: rgba(219, 235, 223, .5); }
.agent3d-subhead-dot {
  width: 5px; height: 5px; border-radius: 50%; flex: none;
  background: var(--dot, #7ec8a0);
  box-shadow: 0 0 7px var(--dot, #7ec8a0);
}

/* ---- 术语解释 ---- */
.agent3d-terms:not(:empty) { margin-bottom: 18px; }
.agent3d-term-list {
  margin: 0; padding: 0;
  border-left: 2px solid rgba(255, 255, 255, .09);
}
.agent3d-term-k {
  position: relative;
  font-size: 13px; font-weight: 800; color: #eef6f0;
  padding-left: 14px; margin: 0 0 3px;
}
.agent3d-term-k::before {
  content: ""; position: absolute; left: -3px; top: 7px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--dot, #7ec8a0);
}
.agent3d-term-k:not(:first-child) { margin-top: 12px; }
.agent3d-term-v {
  font-size: 12.5px; line-height: 1.72;
  color: rgba(219, 235, 223, .6);
  padding-left: 14px; margin: 0;
}

.agent3d-links { display: flex; flex-direction: column; gap: 6px; }
.agent3d-link {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: #dbeadf; text-decoration: none;
  padding: 8px 12px; border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  transition: background .18s, border-color .18s, transform .18s;
  min-width: 0;
}
.agent3d-link:hover {
  background: rgba(126, 200, 160, .14);
  border-color: rgba(126, 200, 160, .42);
  transform: translateX(3px);
}
/* 核心笔记：左侧色条强调 */
.agent3d-link.is-core {
  background: rgba(255, 255, 255, .065);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: inset 3px 0 0 var(--dot, #7ec8a0);
}
.agent3d-link.is-more { font-size: 12.5px; padding: 7px 12px; }
.agent3d-link.is-more .agent3d-link-arrow { opacity: .62; font-weight: 700; }
.agent3d-link.is-more .agent3d-link-text { color: rgba(219, 235, 223, .78); }
.agent3d-link-arrow { color: var(--dot, #7ec8a0); flex: none; font-weight: 900; }
.agent3d-link-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 推荐阅读顺序 ---- */
.agent3d-order:not(:empty) {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 18px; padding: 11px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
  border: 1px dashed rgba(255, 255, 255, .13);
}
.agent3d-order-icon {
  color: var(--dot, #7ec8a0); flex: none;
  display: flex; align-items: center; margin-top: 2px;
}
.agent3d-order-text {
  font-size: 12.5px; line-height: 1.75;
  color: rgba(219, 235, 223, .66);
}

/* ============================================
   一次完整调用流程（首页 #agent .agent3d-flow）
   ============================================ */
.agent3d-flow {
  margin-top: 26px;
  padding: 30px 34px 32px;
  border-radius: 20px;
  background: linear-gradient(150deg, #1d2f24 0%, #16241c 55%, #1a2620 100%);
  border: 1.5px solid rgba(53, 84, 63, .28);
  box-shadow: 0 18px 0 rgba(53, 84, 63, .07), 0 2px 0 rgba(0, 0, 0, .04);
}
.agent3d-flow-head { margin-bottom: 22px; }
.agent3d-flow-tag {
  display: inline-block; font-size: 11px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: #8fd3ac; background: rgba(143, 211, 172, .1);
  border: 1px solid rgba(143, 211, 172, .24);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 10px;
}
.agent3d-flow-head h3 {
  font-family: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif;
  font-size: 22px; color: #f2f8f3; margin: 0 0 7px; line-height: 1.4;
}
.agent3d-flow-head p {
  font-size: 13.5px; line-height: 1.75;
  color: rgba(219, 235, 223, .62); margin: 0;
}

/* 步骤条 */
.agent3d-flow-steps {
  display: grid; gap: 9px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
}
.agent3d-step {
  position: relative;
  display: flex; flex-direction: column; gap: 5px;
  padding: 13px 13px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1.5px solid rgba(255, 255, 255, .075);
  cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: background .22s, border-color .22s, transform .22s;
  min-width: 0;
}
.agent3d-step:hover { background: rgba(255, 255, 255, .08); transform: translateY(-2px); }
.agent3d-step.on {
  background: var(--tint, rgba(126, 200, 160, .16));
  border-color: var(--dot, #7ec8a0);
  transform: translateY(-2px);
}
.agent3d-step-no {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1px;
  color: var(--dot, #7ec8a0); text-transform: uppercase;
}
.agent3d-step-title {
  font-size: 13px; font-weight: 800; color: #eef6f0;
  line-height: 1.45;
}
.agent3d-step-text {
  font-size: 11.5px; line-height: 1.65;
  color: rgba(219, 235, 223, .55);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.agent3d-step.on .agent3d-step-text { color: rgba(235, 247, 239, .72); }

/* 当前步骤详解 */
.agent3d-flow-detail {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px;
  padding: 15px 18px; border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .09);
  border-left: 3px solid var(--dot, #7ec8a0);
  min-height: 62px;
  transition: border-color .25s;
}
.agent3d-flow-detail:empty { display: none; }
.agent3d-flow-detail-step {
  font-size: 11px; font-weight: 800; letter-spacing: .8px;
  color: var(--dot, #7ec8a0); text-transform: uppercase; flex: none;
}
.agent3d-flow-detail-title {
  font-size: 14px; font-weight: 800; color: #f2f8f3; flex: none;
}
.agent3d-flow-detail-text {
  font-size: 13px; line-height: 1.7;
  color: rgba(219, 235, 223, .68); flex: 1 1 100%; min-width: 0;
}

/* 降级：WebGL 不可用时 */
.agent3d-no3d {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 36px; text-align: center;
  color: rgba(219, 235, 223, .62); font-size: 13.5px; line-height: 1.9;
}
.agent3d-diag {
  font-size: 11.5px; color: rgba(219, 235, 223, .42);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px; padding: 6px 14px;
  max-width: 90%; word-break: break-word;
}

/* ===== 响应式 ===== */
@media (max-width: 1180px) {
  /* 中屏收窄：面板变窄后详情更需要滚动，稍微加高整体 */
  .agent3d { height: 620px; }
  .agent3d-panel { padding: 28px 26px 28px 24px; }
}
@media (max-width: 980px) {
  /* 单列：舞台固定高 + 面板自然高，取消整体定高 */
  .agent3d {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }
  .agent3d-stage { height: 400px; min-height: 0; }
  .agent3d-panel {
    border-left: 0; border-top: 1.5px solid rgba(255, 255, 255, .09);
    padding: 26px 22px 30px;
    overflow: visible;
  }
  .agent3d-detail { overflow: visible; padding-right: 0; margin-right: 0; }
  .agent3d-layer-role { display: none; }
  /* 流程：中屏 3 列 */
  .agent3d-flow { padding: 24px 22px 26px; }
  .agent3d-flow-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .agent3d { border-radius: 16px; }
  .agent3d-stage { height: 330px; }
  .agent3d-panel { padding: 22px 17px 26px; }
  .agent3d-title { font-size: 21px; }
  .agent3d-badge { right: 12px; bottom: 12px; padding: 7px 12px; font-size: 11.5px; }
  .agent3d-hint { left: 12px; top: 12px; font-size: 11px; padding: 4px 11px; }
  .agent3d-link { font-size: 12.5px; }
  .agent3d-term-v { font-size: 12px; }
  /* 流程：小屏 2 列 */
  .agent3d-flow { padding: 20px 16px 22px; border-radius: 16px; margin-top: 20px; }
  .agent3d-flow-head h3 { font-size: 19px; }
  .agent3d-flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .agent3d-step { padding: 11px 11px 12px; }
  .agent3d-step-text { -webkit-line-clamp: 3; }
  .agent3d-flow-detail { padding: 13px 14px; }
}
