/* knowledge.html — 四层知识框架解析页 */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --node: #3b82f6;
  --edge: #16a34a;
  --peri: #d97706;
  --exam: #dc2626;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --radius: 16px;
}
html[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: #1f2937;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(1000px 420px at 50% -120px, rgba(59, 130, 246, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
}

.site-header,
.site-footer,
.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 14px;
}
.brand {
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 14px;
}
.site-header a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.site-header a[aria-current="page"],
.site-header a:hover { color: var(--node); }

.theme-btn {
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}
.theme-btn:hover { border-color: #60a5fa; }

.page { padding-bottom: 48px; }

.hero { padding: 28px 0 8px; }
.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.lede {
  color: var(--muted);
  max-width: 52ch;
  font-size: 1.02rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.btn {
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}
.btn.ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn.ghost:hover { border-color: #60a5fa; color: #2563eb; }

.stage {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}
#stageLabel {
  font-weight: 800;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}

.layers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.layer {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  background: var(--bg);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.25s ease;
  opacity: 0.55;
  outline: none;
}
.layer:hover,
.layer:focus-visible { opacity: 1; transform: translateY(-3px); }
.layer.is-active {
  opacity: 1;
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.layer-node.is-active { border-color: var(--node); }
.layer-edge.is-active { border-color: var(--edge); }
.layer-peri.is-active { border-color: var(--peri); }
.layer-exam.is-active { border-color: var(--exam); }

.layer-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.layer-node .layer-badge { background: #dbeafe; color: #1d4ed8; }
.layer-edge .layer-badge { background: #dcfce7; color: #15803d; }
.layer-peri .layer-badge { background: #fef3c7; color: #b45309; }
.layer-exam .layer-badge { background: #fee2e2; color: #b91c1c; }
html[data-theme="dark"] .layer-node .layer-badge { background: #1e3a5f; color: #93c5fd; }
html[data-theme="dark"] .layer-edge .layer-badge { background: #14532d; color: #86efac; }
html[data-theme="dark"] .layer-peri .layer-badge { background: #451a03; color: #fbbf24; }
html[data-theme="dark"] .layer-exam .layer-badge { background: #450a0a; color: #fca5a5; }

.layer h2 {
  font-size: 1.02rem;
  line-height: 1.35;
  margin-bottom: 8px;
}
.layer-q {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.layer-node .layer-q { color: #1d4ed8; }
.layer-edge .layer-q { color: #15803d; }
.layer-peri .layer-q { color: #b45309; }
.layer-exam .layer-q { color: #b91c1c; }
html[data-theme="dark"] .layer-q { filter: brightness(1.15); }

.layer-a {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.layer-eg {
  list-style: none;
  font-size: 0.82rem;
  color: var(--text);
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.layer-eg li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
}
.layer-tag {
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px dashed var(--line);
  color: var(--muted);
}

.depth-panel {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}
.depth-panel h3 { font-size: 0.95rem; margin-bottom: 10px; }
.depth-steps { display: grid; gap: 8px; }
.depth-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 0.9rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  animation: rise 0.35s ease both;
}
.depth-step .n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: #2563eb;
}
.depth-step strong { display: block; margin-bottom: 2px; }
.depth-step span { color: var(--muted); font-size: 0.86rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--line);
}
.card h3 { font-size: 1rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.92rem; }
.card-node { border-left-color: var(--node); }
.card-edge { border-left-color: var(--edge); }
.card-peri { border-left-color: var(--peri); }
.card-exam { border-left-color: var(--exam); }

.workflow {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.workflow h2 { font-size: 1.15rem; margin-bottom: 12px; }
.workflow ol {
  list-style: none;
  display: grid;
  gap: 10px;
}
.workflow li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 7px;
  flex: 0 0 auto;
}
.dot.n { background: var(--node); }
.dot.e { background: var(--edge); }
.dot.p { background: var(--peri); }
.dot.x { background: var(--exam); }
.workflow-tip {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  padding-bottom: 28px;
  color: var(--muted);
  font-size: 0.88rem;
}
.site-footer a { color: var(--node); font-weight: 600; text-decoration: none; }

@media (max-width: 900px) {
  .layers { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .layers { grid-template-columns: 1fr; }
  .layer { opacity: 1; }
  .hero-actions .btn { flex: 1 1 auto; }
}
