:root {
  --bg: #f6f7f9;
  --ink: #202d40;
  --muted: #56667d;
  --border: #dce3eb;
  --blue: #2859b8;
  --teal: #157f78;
  --amber: #b67b24;
  --white: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}
header {
  height: 78px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}
.brand strong {
  font-size: 19px;
  letter-spacing: -0.3px;
}
.brand small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}
.mark {
  background: var(--ink);
  color: white;
  padding: 10px;
  font-size: 20px;
  border-radius: 8px;
  letter-spacing: -2px;
}
.connect {
  display: flex;
  gap: 8px;
}
.platform-nav{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-left:auto}.platform-nav a{color:var(--muted);text-decoration:none;padding:9px 11px;border-radius:8px;font-size:13px;white-space:nowrap}.platform-nav a[aria-current="page"]{background:#e7efe9;color:#23594c;font-weight:650}.platform-nav a:hover{background:#f0f4ef}.research-orientation{margin:0 24px 24px;padding:18px 20px;background:#e7efe9;border:1px solid #d2e0d5;border-radius:12px;color:#375d54}.research-orientation p{margin:0 0 12px;line-height:1.8}.research-orientation div{display:flex;gap:8px;flex-wrap:wrap}.research-orientation span{background:white;padding:6px 10px;border-radius:6px;font-size:12px}.operator-access{padding:12px 28px;border-bottom:1px solid var(--border);background:white;color:var(--muted);font-size:12px}.operator-access summary{cursor:pointer}.operator-access .connect{margin-top:12px}a:focus-visible,summary:focus-visible{outline:3px solid #c5954a;outline-offset:3px}@media(max-width:1150px){header{height:auto;min-height:78px;flex-wrap:wrap;padding-top:14px;padding-bottom:14px;gap:12px}}@media(max-width:820px){.platform-nav{margin:0;gap:4px;order:3;width:100%}.platform-nav a{padding:8px;font-size:12px}.research-orientation{margin:0 16px 20px}.connect{margin-left:auto}}
.access-guide { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px; background: #eef4ff; border-bottom: 1px solid var(--border); }
.access-guide p { margin: 8px 0 0; line-height: 1.7; }
.entry-link { display: inline-block; background: var(--blue); color: white; padding: 12px 18px; border-radius: 8px; text-decoration: none; }
@media (max-width: 700px) { .access-guide { align-items: stretch; flex-direction: column; padding: 18px; } }
.connect input {
  width: 210px;
}
.notice {
  padding: 10px 28px;
  color: #855e1e;
  background: #fff7e8;
  border-bottom: 1px solid #eddfc2;
}
.notice span {
  margin-left: 20px;
  color: #927a56;
}
main {
  display: grid;
  grid-template-columns: 220px minmax(360px, 1fr) 330px;
  min-height: 780px;
}
aside {
  padding: 26px 20px;
  background: white;
}
.sidebar {
  border-right: 1px solid var(--border);
}
.inspector {
  border-left: 1px solid var(--border);
  overflow-wrap: anywhere;
}
h1 {
  font-size: 20px;
  letter-spacing: -0.4px;
  margin: 0;
}
h2 {
  font-size: 18px;
  margin: 20px 0 9px;
}
h3 {
  font-size: 14px;
  margin: 0;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.7px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 12px;
}
.spaced {
  margin-top: 30px;
}
.muted {
  color: var(--muted);
  line-height: 1.7;
}
label {
  display: block;
  margin: 17px 0 5px;
  color: #56667d;
  font-size: 12px;
}
select,
input,
textarea {
  font: inherit;
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px;
  background: white;
  color: var(--ink);
  margin-top: 6px;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
button {
  font: inherit;
  background: var(--blue);
  color: white;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 13px;
  cursor: pointer;
}
button:hover {
  filter: brightness(0.95);
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid #84aff7;
  outline-offset: 2px;
}
.quiet {
  color: #536580;
  background: white;
  border-color: var(--border);
}
.wide {
  width: 100%;
  margin-top: 15px;
}
.toolbar {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.toolbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.toolbar button {
  margin-left: 4px;
}
.graph-wrap {
  height: 480px;
  position: relative;
  margin: 0 20px;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background-color: #fcfdff;
  background-image: radial-gradient(#dbe3f0 0.8px, transparent 0.8px);
  background-size: 20px 20px;
}
svg {
  width: 100%;
  height: 100%;
  touch-action: none;
}
#empty {
  position: absolute;
  top: 40%;
  left: 15%;
  color: var(--muted);
  line-height: 2;
  pointer-events: none;
}
#arrow path {
  fill: #93a3ba;
}
.node {
  cursor: pointer;
}
.node rect {
  fill: white;
  stroke: var(--border);
  stroke-width: 1.2;
  rx: 8;
}
.node:hover rect,
.node.selected rect {
  stroke: var(--blue);
  stroke-width: 2;
}
.node text {
  fill: var(--ink);
  font-size: 12px;
}
.node .meta {
  fill: var(--muted);
  font-size: 10px;
}
.node .badge {
  fill: var(--teal);
  font-size: 10px;
}
.node .negative {
  fill: var(--amber);
}
.edge {
  fill: none;
  stroke: #8e9fb9;
  stroke-width: 1.5;
  cursor: pointer;
}
.edge:hover {
  stroke: var(--blue);
  stroke-width: 4;
}
.edge.evidence {
  stroke-dasharray: 5 5;
  stroke: #b0bdca;
}
.edge-control {
  cursor: pointer;
}
.edge-label-bg {
  fill: #ffffff;
  stroke: #dce4ee;
  stroke-width: 1;
}
.edge-label {
  fill: #65768d;
  font-size: 8px;
  pointer-events: none;
}
.edge-control:focus .edge-label-bg,
.edge-control:hover .edge-label-bg {
  stroke: #295cca;
}
.legend {
  padding: 17px 24px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 10px;
}
.dot.checkpoint {
  background: var(--blue);
}
.dot.evidence {
  background: var(--amber);
}
.dot.artifact {
  background: var(--teal);
}
.line {
  width: 22px;
  border-top: 1px solid #8e9fb9;
  margin-left: 8px;
}
.dashed {
  border-top-style: dashed;
}
.timeline {
  margin: 0 20px 24px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
}
.timeline .toolbar {
  padding: 17px;
}
.event {
  padding: 9px 17px;
  border-top: 1px solid #edf1f6;
  display: flex;
  gap: 12px;
  font-size: 11px;
}
.event small {
  color: var(--muted);
  min-width: 108px;
}
.event button {
  border: 0;
  padding: 0;
  color: var(--blue);
  background: none;
  text-align: left;
}
.branch-card {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.branch-card small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.action-row {
  display: flex;
  gap: 5px;
  margin: 12px 0;
}
.action-row button {
  font-size: 11px;
  padding: 8px;
}
pre {
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 11px;
  line-height: 1.6;
  background: var(--bg);
  padding: 10px;
  border-radius: 6px;
  max-height: 500px;
  overflow: auto;
}
details {
  margin-top: 22px;
}
summary {
  cursor: pointer;
  color: #56667d;
}
.file {
  display: block;
  padding: 8px 0;
  color: var(--blue);
  font-size: 11px;
}
#status {
  color: var(--blue);
  line-height: 1.7;
}
a {
  color: var(--blue);
  text-decoration: none;
}
.evidence-card {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--ink);
  background: white;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin: 10px 0;
  cursor: pointer;
}
.evidence-card strong {
  display: block;
  margin-bottom: 5px;
}
#detailSummary {
  max-height: 150px;
  overflow: auto;
  white-space: pre-wrap;
}
footer {
  border-top: 1px solid var(--border);
  padding: 14px 28px;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}
@media (max-width: 1100px) {
  main {
    grid-template-columns: 190px minmax(350px, 1fr) 270px;
  }
  .toolbar {
    padding: 18px;
  }
  h1 {
    font-size: 16px;
  }
  .notice span {
    display: block;
    margin: 4px 0;
  }
  .connect input {
    width: 140px;
  }
}
@media (max-width: 820px) {
  main {
    display: block;
  }
  .sidebar {
    padding: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  .sidebar h2,
  .sidebar p,
  .sidebar .eyebrow,
  .branch-list {
    display: none;
  }
  .sidebar label {
    width: 140px;
  }
  header {
    padding: 12px;
    height: auto;
    gap: 10px;
    flex-wrap: wrap;
  }
  .inspector {
    border-top: 1px solid var(--border);
  }
  .graph-wrap {
    height: 450px;
  }
  .legend {
    flex-wrap: wrap;
  }
}
[hidden] { display: none !important; }
.track-summary { display: grid; gap: 16px; padding: 0 24px; background: var(--bg); }
.track-summary:empty { display: none; }
.summary-card { margin-top: 20px; border: 1px solid var(--border); background: white; border-radius: 12px; padding: 18px 22px; }
.summary-card small { color: var(--muted); }
.summary-card strong { display: block; margin-top: 8px; font-size: 26px; color: var(--teal); }
.summary-card p { margin: 8px 0 0; line-height: 1.8; }
.summary-card.warning { background: #fff7e8; border-color: #e6c684; }
.summary-card.warning strong { color: #855e1e; }
#connectionState { align-self: center; color: var(--teal); white-space: nowrap; font-size: 12px; }
.people-section { padding: 0 24px 18px; }
#people { display: flex; flex-wrap: wrap; gap: 8px; }
.person-card { text-align: left; flex: 1 1 180px; max-width: 300px; padding: 12px; overflow-wrap: anywhere; }
.person-card strong, .person-card small { display: block; }
.person-card small { line-height: 1.6; font-size: 11px; color: var(--muted); margin-top: 4px; }
.selected { border-color: var(--blue); background: #edf3ff; }
.view-tabs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 24px 16px; }
.view-tabs button[aria-pressed="true"] { background: var(--blue); color: white; }
.view-tabs button[aria-pressed="false"] { background: white; color: var(--muted); border-color: var(--border); }
#researchList { padding: 0 24px 24px; display: grid; gap: 12px; max-height: 560px; overflow: auto; }
.research-card { text-align: left; padding: 16px; color: var(--ink); width: 100%; }
.research-card strong { display: block; font-size: 16px; margin: 8px 0; line-height: 1.6; }
.research-card small { color: var(--muted); }
.card-kind { color: var(--teal) !important; }
.card-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.7; margin-bottom: 10px; }
.branch-card { width: 100%; text-align: left; line-height: 1.6; overflow-wrap: anywhere; }
#profileForm { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-top: 16px; }
#profileId { overflow-wrap: anywhere; font-size: 12px; }
.fact { display: grid; grid-template-columns: 80px 1fr; gap: 8px; line-height: 1.6; }
.fact small { color: var(--muted); }
.empty-list { padding: 32px 0; }
.graph-option { display: flex; gap: 8px; align-items: center; margin: 0 24px 12px; }
.graph-option input { width: auto; margin: 0; }
#graphPanel .graph-wrap { height: 300px; }
#graphPanel.with-evidence .graph-wrap { height: 480px; }
.research-card strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.frozen-metrics { white-space: pre-line; }
#detailFacts h3 { margin-top: 18px; }
button:disabled { opacity: .55; cursor: not-allowed; }
#pages { padding: 0 24px; }
@media (max-width: 1100px) {
  main { grid-template-columns: 190px minmax(300px, 1fr) 280px; }
  .toolbar { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 820px) {
  main { display: block; min-width: 0; }
  .connect { flex-wrap: wrap; }
  .person-card { max-width: none; }
  .people-section, #researchList { padding-left: 16px; padding-right: 16px; }
  .track-summary { padding: 0 12px; }
  .toolbar { padding: 18px 16px; }
  footer { flex-wrap: wrap; gap: 8px; }
}
