.brain-arch {
  display: grid;
  margin-top: 34px;
  padding: 22px;
  gap: 0;
  background:
    linear-gradient(90deg, rgba(11, 103, 178, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(11, 103, 178, 0.055) 1px, transparent 1px),
    #f7fafc;
  background-size: 34px 34px;
  border: 1px solid var(--line);
}

/* ---- 大脑 ---- */
.brain-core {
  position: relative;
  display: grid;
  padding: 26px 28px;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 26px;
  color: #f4f9fb;
  background:
    radial-gradient(120% 180% at 12% 0%, rgba(45, 182, 201, 0.28), transparent 62%),
    radial-gradient(90% 160% at 92% 100%, rgba(25, 118, 210, 0.3), transparent 60%),
    #0e1720;
  border: 1px solid #16313d;
  box-shadow: 0 24px 60px rgba(10, 26, 38, 0.28);
  align-items: center;
}

.brain-core::after {
  position: absolute;
  inset: 8px;
  content: "";
  border: 1px solid rgba(45, 182, 201, 0.22);
  pointer-events: none;
}

.brain-core-tag {
  display: inline-flex;
  padding: 5px 10px;
  gap: 7px;
  color: #7fe2f0;
  background: rgba(45, 182, 201, 0.12);
  border: 1px solid rgba(45, 182, 201, 0.4);
  align-items: center;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brain-core-tag i {
  width: 14px;
  height: 14px;
}

.brain-core-main > strong {
  display: block;
  margin-top: 14px;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.brain-core-main > p {
  margin: 10px 0 0;
  max-width: 54ch;
  color: #a9bcc7;
  font-size: 13.5px;
  line-height: 1.62;
}

.brain-abilities {
  display: flex;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.brain-abilities span {
  display: inline-flex;
  padding: 7px 11px;
  gap: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
}

.brain-abilities i {
  width: 14px;
  height: 14px;
  color: #7fe2f0;
}

.brain-prompt {
  position: relative;
  padding: 18px;
  background: rgba(8, 16, 22, 0.62);
  border: 1px solid rgba(127, 226, 240, 0.28);
}

.brain-prompt-label {
  display: block;
  color: #6f8797;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brain-prompt-text {
  margin: 9px 0 14px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.brain-prompt-result {
  display: flex;
  padding-top: 12px;
  gap: 8px;
  border-top: 1px dashed rgba(127, 226, 240, 0.3);
  align-items: flex-start;
}

.brain-prompt-result i {
  width: 15px;
  height: 15px;
  color: #7fe2f0;
  flex: none;
  margin-top: 2px;
}

.brain-prompt-result b {
  color: #cfe6ee;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
}

/* ---- 双向调度总线 ---- */
.brain-bus {
  position: relative;
  display: grid;
  height: 62px;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.brain-bus-rail {
  position: relative;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, #2db6c9, rgba(45, 182, 201, 0.15));
  justify-self: center;
}

.brain-bus-rail::before,
.brain-bus-rail::after {
  position: absolute;
  left: 50%;
  width: 8px;
  height: 8px;
  content: "";
  background: #2db6c9;
  border-radius: 50%;
  transform: translateX(-50%);
  animation: brain-bus-flow 2.4s linear infinite;
}

.brain-bus-rail::after {
  animation-delay: 1.2s;
}

@keyframes brain-bus-flow {
  0% { top: -4px; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: calc(100% - 4px); opacity: 0; }
}

.brain-bus-down,
.brain-bus-up {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.brain-bus-down {
  justify-self: end;
  color: #0b56a5;
}

.brain-bus-up {
  justify-self: start;
  color: #1f9d72;
}

.brain-bus-down i,
.brain-bus-up i {
  width: 13px;
  height: 13px;
}

/* ---- 04 / 03 / 02 Skill 层 ---- */
.brain-body {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(280px, 0.86fr);
  gap: 20px;
  align-items: stretch;
}

.brain-skills {
  display: grid;
  gap: 12px;
  align-content: start;
}

.skill-layer {
  position: relative;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #d7e1ea;
  border-left: 6px solid var(--layer-color);
  box-shadow: 0 14px 26px rgba(22, 36, 50, 0.07);
}

.skill-layer::before {
  position: absolute;
  top: 22px;
  right: -7px;
  width: 12px;
  height: 12px;
  content: "";
  background: #ffffff;
  border: 3px solid var(--layer-color);
  border-radius: 50%;
}

.skill-layer header {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.skill-no {
  color: var(--layer-color);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.skill-layer header strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.skill-layer header small {
  display: block;
  margin-top: 3px;
  color: #6b7783;
  font-size: 12px;
  line-height: 1.45;
}

.skill-chips {
  display: flex;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 7px;
}

.skill-chips span {
  display: inline-flex;
  padding: 6px 10px;
  gap: 6px;
  color: #253442;
  background: #f5f8fb;
  border: 1px solid #dfe8ef;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.skill-chips span::after {
  content: "Skill";
  margin-left: 2px;
  color: var(--layer-color);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.skill-chips i {
  width: 13px;
  height: 13px;
  color: var(--layer-color);
}

.skill-layer-service { --layer-color: #df2430; }
.skill-layer-model { --layer-color: #0b67b2; }
.skill-layer-data { --layer-color: #1f9d72; }

/* ---- 执行轨迹面板 ---- */
.brain-trace {
  padding: 22px;
  color: #f6f9fb;
  background: #111820;
  box-shadow: 0 22px 52px rgba(22, 36, 50, 0.12);
}

.brain-trace h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.brain-trace > p {
  margin: 9px 0 16px;
  color: #9ba7b2;
  font-size: 13px;
  line-height: 1.55;
}

.trace-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: trace;
}

.trace-step {
  position: relative;
  padding: 12px 6px 12px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  counter-increment: trace;
}

.trace-step::before {
  position: absolute;
  top: 15px;
  left: 6px;
  display: grid;
  width: 20px;
  height: 20px;
  content: counter(trace);
  color: #0d141b;
  background: var(--flow-color);
  border-radius: 50%;
  place-items: center;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
}

.trace-step strong {
  display: block;
  font-size: 13.5px;
  line-height: 1.35;
}

.trace-step span {
  display: block;
  margin-top: 3px;
  color: #96a3ae;
  font-size: 12px;
  line-height: 1.5;
}

.trace-step-brain { --flow-color: #7fe2f0; }
.trace-step-sensing { --flow-color: #e7a12b; }
.trace-step-data { --flow-color: #1f9d72; }
.trace-step-model { --flow-color: #4a9fe0; }
.trace-step-service { --flow-color: #ef5a64; }

/* ---- 01 感知层：设备连接墙 ---- */
.brain-field {
  position: relative;
  margin-top: 20px;
  padding: 20px 22px 22px;
  background: #ffffff;
  border: 1px solid #d7e1ea;
  border-top: 6px solid #e7a12b;
  box-shadow: 0 16px 34px rgba(22, 36, 50, 0.08);
}

.field-uplink {
  position: absolute;
  top: -21px;
  left: 0;
  display: flex;
  width: 100%;
  height: 20px;
  justify-content: space-evenly;
  pointer-events: none;
}

.field-uplink span {
  position: relative;
  width: 1px;
  background: linear-gradient(to top, rgba(231, 161, 43, 0.55), rgba(231, 161, 43, 0));
}

.field-uplink span::before {
  position: absolute;
  left: 50%;
  width: 5px;
  height: 5px;
  content: "";
  background: #e7a12b;
  border-radius: 50%;
  transform: translateX(-50%);
  animation: field-uplink-flow 2.2s linear infinite;
}

.field-uplink span:nth-child(2)::before { animation-delay: 0.35s; }
.field-uplink span:nth-child(3)::before { animation-delay: 0.7s; }
.field-uplink span:nth-child(4)::before { animation-delay: 1.05s; }
.field-uplink span:nth-child(5)::before { animation-delay: 1.4s; }
.field-uplink span:nth-child(6)::before { animation-delay: 1.75s; }

@keyframes field-uplink-flow {
  0% { bottom: 0; opacity: 0; }
  25% { opacity: 1; }
  75% { opacity: 1; }
  100% { bottom: 100%; opacity: 0; }
}

.field-head {
  display: flex;
  padding-bottom: 14px;
  gap: 18px;
  border-bottom: 1px solid #e7edf2;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}

.field-head > div:first-child {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.field-head .skill-no {
  color: #e7a12b;
}

.field-head strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.field-head small {
  display: block;
  margin-top: 3px;
  color: #6b7783;
  font-size: 12px;
}

.field-stats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.field-stats span {
  display: block;
}

.field-stats b {
  display: block;
  color: #17212b;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.field-stats b em {
  font-size: 12px;
  font-style: normal;
}

.field-stats i {
  display: block;
  margin-top: 2px;
  color: #7c8894;
  font-size: 11px;
  font-style: normal;
}

.field-devices {
  display: grid;
  margin-top: 16px;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.device-node {
  position: relative;
  display: grid;
  padding: 14px 10px 12px;
  gap: 2px;
  background: #f7fafc;
  border: 1px solid #dfe8ef;
  justify-items: center;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.device-node:hover {
  border-color: #e7a12b;
  box-shadow: 0 12px 22px rgba(231, 161, 43, 0.18);
  transform: translateY(-3px);
}

.device-node i {
  width: 30px;
  height: 30px;
  margin-bottom: 6px;
  color: #34505f;
  stroke-width: 1.5;
}

.device-node strong {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
}

.device-node small {
  color: #7c8894;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  line-height: 1.35;
}

.device-node::after {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
}

.device-node.is-online::after {
  background: #1f9d72;
  box-shadow: 0 0 0 3px rgba(31, 157, 114, 0.18);
  animation: device-pulse 2s ease-in-out infinite;
}

.device-node.is-offline {
  opacity: 0.6;
}

.device-node.is-offline::after {
  background: #b6c0ca;
}

@keyframes device-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(31, 157, 114, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(31, 157, 114, 0.06); }
}

@media (prefers-reduced-motion: reduce) {
  .brain-bus-rail::before,
  .brain-bus-rail::after,
  .field-uplink span::before,
  .device-node.is-online::after {
    animation: none;
  }
}
