/* =============================================================================
 * style.css  ——  工业深色主题 / 单页简历 Demo
 * ========================================================================== */
:root {
  --bg: #0a0e14;
  --panel: #121821;
  --panel-2: #0f1520;
  --line: #1e2a38;
  --txt: #d7e3f0;
  --txt-dim: #8fa3b8;
  --accent: #35b6ff;
  --accent-2: #2fe08a;
  --warn: #ffb020;
  --danger: #ff4d5e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding: 18px 20px 40px;
}

/* ---------------- 顶栏 ---------------- */
.topbar { max-width: 1320px; margin: 0 auto 16px; }

.brand { display: flex; align-items: center; gap: 10px; }

.led {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
  flex: none;
}

.topbar h1 { font-size: 20px; font-weight: 700; letter-spacing: .3px; }

.tagline { color: var(--txt-dim); font-size: 13px; margin-top: 4px; }

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border: 1px solid #26445c;
  border-radius: 10px;
  color: #7fc6f5;
  font-size: 12px;
}

/* ---------------- 布局 ---------------- */
.layout {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.col-left, .col-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}

.card.flush { padding: 0; overflow: hidden; }

.card h2 {
  font-size: 13px;
  font-weight: 700;
  color: #9fc7e8;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.card h3 {
  font-size: 12px;
  color: var(--txt-dim);
  letter-spacing: .8px;
  margin: 16px 0 8px;
}

.card-head { display: flex; align-items: center; justify-content: space-between; }
.card-head h2 { margin-bottom: 10px; }

/* ---------------- 架构层 ---------------- */
.layer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 9px 11px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.layer b { font-size: 12.5px; color: #cfe3f7; letter-spacing: .5px; }
.layer span { font-size: 11.5px; color: var(--txt-dim); line-height: 1.5; }

.layer.upper { border-left: 3px solid var(--accent-2); }
.layer.iface { border-left: 3px solid var(--accent); }
.layer.sdk   { border-left: 3px solid var(--warn); }

.layer.adapters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  background: transparent;
  border-style: dashed;
}

.adapter {
  cursor: pointer;
  background: #16202c;
  border: 1px solid #22303f;
  border-radius: 6px;
  color: #a9c2d8;
  font-family: inherit;
  font-size: 12px;
  padding: 8px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  transition: all .15s;
}

.adapter i { font-style: normal; font-size: 10px; color: #5f7c96; }

.adapter:hover { border-color: #35506b; color: #d0e6f8; }

.adapter.active {
  background: rgba(53, 182, 255, .14);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(53, 182, 255, .3), 0 0 14px rgba(53, 182, 255, .18);
}

.adapter.active i { color: #7fc6f5; }

/* ---------------- KPI ---------------- */
.kpi {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.kpi div {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.kpi em {
  display: block;
  font-style: normal;
  font-family: Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.kpi span { font-size: 10.5px; color: var(--txt-dim); }

/* ---------------- 状态机 chips ---------------- */
.state-row { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  font-family: Consolas, monospace;
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid #22303f;
  background: #10161f;
  color: #6f849a;
  transition: all .15s;
}

.chip.on {
  color: #04121c;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(53, 182, 255, .45);
  font-weight: 700;
}

.chip.warn.on {
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 0 14px rgba(255, 77, 94, .45);
  color: #fff;
}

/* ---------------- 按钮 ---------------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }

.b {
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  color: #b9cede;
  background: #16202c;
  border: 1px solid #22303f;
  border-radius: 6px;
  padding: 7px 12px;
  transition: all .15s;
}

.b:hover { background: #1c2836; border-color: #35506b; color: #eaf4ff; }
.b:active { transform: translateY(1px); }

.b.primary {
  background: rgba(53, 182, 255, .16);
  border-color: #2b7fb5;
  color: #bfe4ff;
}

.b.primary:hover { background: rgba(53, 182, 255, .26); }

.b.danger {
  background: rgba(255, 77, 94, .18);
  border-color: #a32a35;
  color: #ffc2c8;
}

.b.tiny { padding: 3px 9px; font-size: 11.5px; }

/* ---------------- 画布 ---------------- */
.canvas-wrap {
  position: relative;
  background: #0b1017;
  padding: 0;
  display: block;
}

#viewport { display: block; width: 100%; }

.canvas-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 12px;
  font-size: 11.5px;
  color: var(--txt-dim);
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}

/* ---------------- 控制台 ---------------- */
.console {
  height: 230px;
  overflow-y: auto;
  background: #080d13;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11.5px;
  line-height: 1.65;
  color: #9fd8b4;
}

.log-line { white-space: pre-wrap; word-break: break-all; }
.log-line .t { color: #4d6b85; margin-right: 8px; }
.console::-webkit-scrollbar { width: 8px; }
.console::-webkit-scrollbar-thumb { background: #1e2a38; border-radius: 4px; }

/* ---------------- 说明 ---------------- */
.hint {
  margin-top: 10px;
  font-size: 11.5px;
  color: #7d93a9;
  line-height: 1.65;
  border-left: 2px solid #22303f;
  padding-left: 9px;
}

/* ---------------- 页脚 ---------------- */
.foot {
  max-width: 1320px;
  margin: 20px auto 0;
  font-size: 12.5px;
  color: var(--txt-dim);
}

.foot details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 16px;
}

.foot summary {
  cursor: pointer;
  color: #9fc7e8;
  font-size: 13px;
  outline: none;
}

.foot p { margin-top: 9px; line-height: 1.75; }
.foot b { color: #cfe3f7; }
.sign { margin-top: 10px; text-align: center; font-size: 11.5px; color: #5f7c96; }

/* ---------------- 3D 回放入口（2026-12-05 新增） ---------------- */
.sim-entry { max-width: 1320px; margin: 0 auto 16px; }

.sim-entry a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(90deg, rgba(53, 182, 255, .10), rgba(47, 224, 138, .05));
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  text-decoration: none;
  color: var(--txt);
  transition: border-color .15s, transform .15s;
}

.sim-entry a:hover { border-color: var(--accent); transform: translateX(2px); }
.sim-entry b { font-size: 15px; color: #eaf6ff; white-space: nowrap; }
.sim-entry span { flex: 1; color: var(--txt-dim); font-size: 12.5px; }
.sim-entry i { font-style: normal; color: var(--accent); font-size: 13px; white-space: nowrap; }

@media (max-width: 560px) {
  .sim-entry a { flex-wrap: wrap; gap: 4px 10px; }
  .sim-entry span { flex-basis: 100%; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1040px) {
  .layout { grid-template-columns: 1fr; }
  .col-right { order: -1; }
  .console { height: 190px; }
}

@media (max-width: 560px) {
  body { padding: 12px 10px 28px; }
  .topbar h1 { font-size: 16px; }
  .tagline { font-size: 12px; }
  .kpi { grid-template-columns: repeat(2, 1fr); }
  .layer.adapters { grid-template-columns: repeat(2, 1fr); }
  .console { height: 170px; font-size: 11px; }
  .b { padding: 8px 10px; }
}