:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #5b6472;
  --line: #d9dee8;
  --brand: #2563eb;
  --accent: #0f766e;
  --warn: #b45309;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  background: linear-gradient(180deg, #eef4ff 0, var(--bg) 220px);
  color: var(--ink);
  line-height: 1.65;
}
main, header { max-width: 1180px; margin: 0 auto; padding: 24px; }
header { padding-top: 36px; }
h1 { margin: 0 0 10px; font-size: 32px; letter-spacing: 0; overflow-wrap: anywhere; }
h2 { margin-top: 32px; border-left: 5px solid var(--brand); padding-left: 12px; }
h3 { margin-top: 24px; color: #111827; }
p, li { color: var(--muted); overflow-wrap: anywhere; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.mobile-title-break { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #dbeafe; color: #1e40af; font-size: 12px; margin-right: 6px; }
.badge.flow { background: #ccfbf1; color: #115e59; }
.badge.learning { background: #fef3c7; color: #92400e; }
.note { border-left: 4px solid var(--accent); background: #ecfdf5; padding: 12px 14px; border-radius: 10px; }
.warn { border-left-color: var(--warn); background: #fff7ed; }
.markmap-wrap {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  height: min(74vh, 760px);
  min-height: 560px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.markmap-wrap.knowledge-map { height: min(82vh, 920px); min-height: 660px; }
.markmap-svg { width: 100%; height: 100%; display: block; }
.markmap-link { fill: none; stroke: #9ca3af; stroke-width: 1.4px; }
.markmap-node circle { fill: #fff; stroke: #9ca3af; stroke-width: 1.5px; }
.markmap-foreign {
  color: #1f2937;
  font: 600 18px/24px -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
.markmap-foreign code {
  font-size: 0.9em;
  background: #eef2ff;
  color: #3730a3;
}
.map-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.section-lead { margin: 10px 0 16px; max-width: 920px; }
code { background: #eef2ff; color: #3730a3; padding: 1px 5px; border-radius: 6px; overflow-wrap: anywhere; word-break: break-word; }
.source-list code { color: #0f766e; background: #ecfdf5; }
footer { max-width: 1180px; margin: 30px auto; padding: 0 24px 32px; color: var(--muted); }
@media (max-width: 760px) {
  h1 { font-size: 26px; word-break: break-all; }
  main, header { padding: 18px; }
  .markmap-wrap { min-height: 520px; height: 72vh; border-radius: 12px; }
  .markmap-wrap.knowledge-map { min-height: 620px; height: 78vh; }
  .mobile-title-break { display: block; }
  .markmap-foreign {
    font: 600 15px/20px -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  }
}
