@charset "UTF-8";
:root {
  font-family: Inter, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  color: #293b33;
  background: #f8f9f5;
  font-size: 13px;
  --line: #dde4db;
  --green: #28654e;
  --muted: #819084;
  --cream: #fffdf4;
  --blue: #eff5fc;
  --rose: #fcf0ef;
  --sage: #eef5eb;
}
* {
  box-sizing: border-box;
}
html,
body,
#app {
  height: 100%;
  margin: 0;
  overflow: hidden;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 7px 12px;
  white-space: nowrap;
}
button:hover {
  background: #f2f6ee;
  border-color: #b4c9b8;
}
button:disabled {
  opacity: 0.36;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #9bc0a7;
  outline-offset: 3px;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.primary:hover {
  background: #1b503b;
}
.ghost {
  background: transparent;
  border-color: transparent;
}
.small {
  font-size: 11px;
  padding: 5px 8px;
}
.danger {
  color: #a45248;
}
.active {
  background: #e5efdf;
  border-color: #a1bea5;
  color: #245d43;
}
h1,
h2,
p {
  margin: 0;
}
a {
  color: var(--green);
}
.boot {
  padding: 80px;
  text-align: center;
}
.workspace {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.topbar {
  min-height: 68px;
  flex: none;
  border-bottom: 1px solid var(--line);
  background: #ffffffed;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  position: relative;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border: 1px solid #9db5a0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--green);
  font-size: 24px;
}
.brand-name {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: 2px;
}
.board-picker {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 110px;
  width: 228px;
  max-width: 28vw;
  gap: 2px;
}
.title-input {
  min-width: 0;
  width: 100%;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
}
.title-input:hover {
  border-color: var(--line);
}
.title-input:focus {
  outline: 2px solid #9bc0a7;
  outline-offset: 1px;
  background: #fff;
}
#board-menu-toggle {
  flex: none;
  min-width: 32px;
  padding: 7px;
}
.popup-menu {
  position: absolute;
  z-index: 16;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 28px #283f3020;
  overflow-y: auto;
  max-height: min(360px, calc(100dvh - 100px));
}
.popup-menu > button,
.popup-menu .menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border-color: transparent;
  background: transparent;
  padding: 9px 10px;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.popup-menu > button:hover,
.popup-menu .menu-item:hover,
.popup-menu .current {
  background: #eef5eb;
}
.popup-menu .current {
  color: var(--green);
  font-weight: 600;
}
.popup-menu hr,
.menu-separator {
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 6px 4px;
}
.board-menu {
  top: calc(100% + 8px);
  left: 0;
  width: 250px;
  max-width: calc(100vw - 24px);
}
.top-grow {
  flex: 1;
  min-width: 0;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.file-picker {
  position: relative;
  flex: none;
}
#file-menu-toggle[aria-expanded='true'] {
  background: #eef5eb;
}
.file-menu {
  top: calc(100% + 8px);
  right: 0;
  width: 296px;
  max-width: calc(100vw - 24px);
  overscroll-behavior: contain;
}
.file-import-panel {
  margin: 6px 4px 2px;
  padding: 12px 6px 4px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.file-import-status {
  color: #6e8068;
  white-space: pre-wrap;
}
.file-import-status.error {
  color: #a25342;
}
.file-import-summary {
  margin-top: 8px;
  padding: 9px 10px;
  background: #f3f6ee;
  border-radius: 7px;
  white-space: pre-wrap;
}
.file-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.file-import-actions button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
  white-space: normal;
}
.save-state {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  margin-right: 6px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.save-state.error {
  color: #ad6337;
}
.stage-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}
.stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  outline: none;
  cursor: crosshair;
  background-color: #f7f8f3;
  background-image: radial-gradient(#c5cfbd 0.8px, transparent 0.8px);
  background-size: 24px 24px;
}
.stage.connecting {
  cursor: crosshair;
}
.stage.selecting {
  cursor: crosshair;
}
.stage.pan-ready {
  cursor: grab;
}
.stage.panning,
.stage.dragging {
  cursor: grabbing;
}
.marquee {
  position: absolute;
  border: 1px solid #5d9874;
  background: #8db69b26;
  pointer-events: none;
}
.selection-summary {
  padding: 0 6px;
  font-size: 12px;
  color: #526b57;
}
.world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.edges {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
}
.edge-path {
  stroke: #a4b4a0;
  stroke-width: 1.8;
  fill: none;
  pointer-events: none;
}
.edge-hit {
  stroke: transparent;
  stroke-width: 16;
  fill: none;
  pointer-events: stroke;
  cursor: pointer;
}
.edge.selected .edge-path {
  stroke: #38785a;
  stroke-width: 2.5;
}
.edge-label {
  font-size: 11px;
  fill: #7c8f78;
  paint-order: stroke;
  stroke: #f7f8f3;
  stroke-width: 5px;
  pointer-events: none;
}
.nodes {
  position: absolute;
  left: 0;
  top: 0;
}
.idea {
  position: absolute;
  width: 225px;
  min-height: 98px;
  border: 1px solid #dbddce;
  border-radius: 13px;
  background: var(--cream);
  box-shadow: 0 5px 16px #30452f08;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition:
    box-shadow 0.13s,
    border-color 0.13s;
  overflow: visible;
}
.idea.green {
  background: var(--sage);
  border-color: #ccdccc;
}
.idea.blue {
  background: var(--blue);
  border-color: #d0ddeb;
}
.idea.rose {
  background: var(--rose);
  border-color: #e6d7d1;
}
.idea.selected {
  border-color: #80a38c;
  box-shadow:
    0 0 0 2px #bdd4b94d,
    0 7px 18px #30452f0a;
}
.idea.editing {
  cursor: text;
  box-shadow:
    0 0 0 3px #c5dcb266,
    0 8px 22px #30452f10;
}
.idea.connection-source {
  border-color: #5d9874;
  border-style: dashed;
}
.idea .idea-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.75;
  font-size: 15px;
  padding: 22px;
  min-height: 96px;
  max-height: 650px;
  overflow: auto;
}
.idea .idea-text:empty::after {
  content: '写下任何想法…';
  color: #a3aa97;
}
.idea .idea-text::first-line {
  font-weight: 600;
}
.idea-editor {
  display: block;
  width: 100%;
  min-height: 96px;
  max-height: 650px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  padding: 22px;
  line-height: 1.75;
  font-size: 15px;
  overflow: auto;
  border-radius: 13px;
  user-select: text;
  touch-action: auto;
}
.idea-editor::placeholder {
  color: #a3aa97;
}
.floating {
  position: absolute;
  z-index: 4;
  background: #ffffffef;
  border: 1px solid #e0e6db;
  border-radius: 12px;
  box-shadow: 0 4px 20px #32483007;
  backdrop-filter: blur(10px);
}
.toolbar {
  display: flex;
  flex: none;
  gap: 2px;
  align-items: center;
}
.toolbar button {
  border-color: transparent;
  background: transparent;
  min-width: 34px;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}
.toolbar button:hover {
  background: #f0f5eb;
}
.toolbar .primary {
  background: var(--green);
  color: white;
}
.toolbar .primary:hover {
  background: #1d563e;
}
.toolbar .active {
  background: #e4f0de;
  border-color: #b6cdb0;
}
.sep {
  height: 22px;
  width: 1px;
  background: #e4e9e0;
  margin: 0 4px;
}
.selection-tools {
  padding: 5px;
  display: flex;
  width: max-content;
  max-width: calc(100% - 16px);
  gap: 2px;
  align-items: center;
  z-index: 7;
}
.selection-tools > button {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
  border-color: transparent;
  background: transparent;
}
.selection-tools > button:hover,
.selection-tools > button[aria-expanded='true'] {
  background: #eef5eb;
}
.selection-tools .tool-more {
  min-width: 40px;
}
.card-menu {
  top: calc(100% + 8px);
  right: 0;
  width: 186px;
}
.selection-tools.menu-above .card-menu,
.card-menu.menu-above {
  top: auto;
  bottom: calc(100% + 8px);
}
.palette {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 5px;
  gap: 8px;
}
.swatch {
  flex: none;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  padding: 0;
  margin: 0;
  border: 1px solid #d3dacc;
  background: var(--cream);
}
.swatch.green {
  background: #dfeedd;
}
.swatch.blue {
  background: #dceafb;
}
.swatch.rose {
  background: #f3deda;
}
.swatch.chosen {
  outline: 2px solid #7c9a81;
  outline-offset: 2px;
}
.zoom {
  right: 22px;
  bottom: 21px;
  display: flex;
  align-items: center;
  padding: 5px;
  gap: 2px;
}
.zoom button {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  font-size: 15px;
}
.zoom .percent {
  min-width: 42px;
  font-size: 11px;
  text-align: center;
  color: #6b7e68;
  font-variant-numeric: tabular-nums;
}
.zoom .fit {
  font-size: 11px;
}
.connect-message {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  background: #315b40;
  color: #f4f8ee;
  font-size: 12px;
  border-radius: 9px;
  padding: 9px 13px;
  z-index: 6;
  box-shadow: 0 4px 18px #27452c12;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  white-space: normal;
}
.connect-message button {
  background: #52765a;
  color: white;
  border: 0;
  padding: 3px 8px;
  font-size: 10px;
}
.recovery {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 16px;
  z-index: 8;
  border: 1px solid #e1caa1;
  background: #fff4dd;
  color: #8f6d37;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 11px;
  border-radius: 9px;
}
.recovery p {
  flex: 1;
}
.recovery button {
  font-size: 11px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  transform: translateX(-50%);
  background: #2c4936;
  color: #f8faf4;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 12px;
  box-shadow: 0 4px 20px #2b432218;
  z-index: 30;
  max-width: 90vw;
}
.help-pop {
  right: 20px;
  top: 16px;
  width: 310px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  padding: 22px;
  z-index: 12;
  font-size: 12px;
  line-height: 1.9;
  color: #6e8068;
}
.help-pop h2 {
  font-size: 17px;
  color: #36573b;
  margin-bottom: 12px;
}
.help-pop p {
  margin-bottom: 11px;
}
.help-pop kbd {
  display: inline-block;
  background: #eef3e9;
  padding: 0 5px;
  border: 1px solid #dfe8d7;
  border-radius: 4px;
  font-family: inherit;
  font-size: 10px;
}
.help-pop .help-close {
  float: right;
  font-size: 17px;
  border: 0;
  background: transparent;
  padding: 0 4px;
}
.help-pop .subtle {
  font-size: 10px;
  color: #8f9c89;
  border-top: 1px solid #e3eadd;
  padding-top: 12px;
  margin-top: 14px;
}
.help-pop a {
  color: #7e9277;
}
.mcp-panel {
  top: 16px;
  right: 20px;
  z-index: 13;
  width: 344px;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 32px);
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.mcp-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.mcp-panel h2 {
  font-size: 17px;
  color: #36573b;
}
.mcp-panel-close {
  padding: 0 7px;
  font-size: 23px;
  line-height: 1.4;
}
.mcp-description,
.mcp-notice,
.mcp-configuration p {
  color: #6e8068;
}
.mcp-scope {
  margin-top: 12px;
  font-weight: 600;
}
.mcp-permission {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.mcp-permission select {
  min-width: 118px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 6px 10px;
}
.mcp-panel select:focus-visible,
.mcp-panel textarea:focus-visible,
.mcp-panel summary:focus-visible {
  outline: 3px solid #9bc0a7;
  outline-offset: 3px;
}
.mcp-notice {
  margin-top: 10px;
  font-size: 11px;
}
.mcp-status {
  margin-top: 12px;
  color: #28654e;
}
.mcp-status.error {
  color: #a25342;
}
.mcp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.mcp-actions button,
.mcp-configuration button {
  min-height: 36px;
  padding: 7px 11px;
}
.mcp-configuration {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.mcp-options {
  margin-top: 12px;
  color: #6e8068;
}
.mcp-options summary {
  cursor: pointer;
}
.mcp-options p {
  margin-top: 8px;
  font-size: 11px;
}
.mcp-options button {
  margin-top: 10px;
  min-height: 36px;
}
.mcp-existing {
  margin-top: 12px;
}
.mcp-configuration summary {
  cursor: pointer;
  font-weight: 600;
}
.mcp-configuration p {
  margin-top: 10px;
  font-size: 11px;
}
.mcp-config-text {
  display: block;
  width: 100%;
  min-height: 170px;
  max-height: 300px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f3;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.5;
  resize: vertical;
  white-space: pre;
  overflow: auto;
}
#ai-menu-toggle.mcp-connected {
  color: var(--green);
  background: #eef5eb;
}
#ai-menu-toggle.mcp-connected::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 5px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--green);
}
.hidden,
[hidden] {
  display: none !important;
}
dialog {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: #344932;
  box-shadow: 0 20px 90px #203a2126;
  width: 470px;
  max-width: calc(100vw - 28px);
}
dialog::backdrop {
  background: #2036223b;
}
dialog h2 {
  font-size: 20px;
  margin-bottom: 12px;
}
dialog p {
  font-size: 12px;
  line-height: 1.9;
  color: #7a8872;
  margin-bottom: 15px;
}
dialog input[type='text'] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9e1d2;
  border-radius: 8px;
  outline-color: #a5c398;
}
dialog .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}
.dialog-x {
  float: right;
  border: 0;
  padding: 0 5px;
  background: transparent;
  font-size: 20px;
}
.empty-guide {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 3;
  color: #85947e;
  pointer-events: none;
}
.empty-guide p {
  font-size: 13px;
  margin: 14px;
}
.empty-guide button {
  pointer-events: auto;
}
@media (max-width: 1000px) {
  .topbar {
    gap: 10px;
    padding: 10px 14px;
  }
  .top-actions {
    gap: 2px;
  }
  .save-state {
    margin-right: 4px;
    max-width: 120px;
  }
  .board-picker {
    width: 195px;
    max-width: 25vw;
  }
}
@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 10px 12px;
  }
  .brand-name {
    font-size: 18px;
  }
  .brand-mark {
    width: 26px;
    height: 26px;
  }
  .board-picker {
    flex: 1 1 calc(100% - 110px);
    width: auto;
    max-width: none;
    min-width: 130px;
  }
  .board-menu {
    left: auto;
    right: 0;
  }
  .title-input {
    font-size: 13px;
  }
  .top-grow {
    display: none;
  }
  .toolbar {
    order: 2;
  }
  .top-actions {
    order: 3;
    flex: 1;
    justify-content: flex-end;
  }
  .top-actions > button,
  #file-menu-toggle {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 12px;
  }
  .file-menu {
    max-height: calc(100dvh - 150px);
  }
  .save-state {
    max-width: 160px;
    margin-right: auto;
  }
  .zoom {
    bottom: 14px;
    right: 12px;
  }
  .help-pop {
    right: 12px;
    max-height: calc(100dvh - 150px);
  }
  .mcp-panel {
    right: 12px;
    padding: 16px;
  }
  .recovery {
    left: 12px;
    right: 12px;
    flex-wrap: wrap;
  }
  .recovery p {
    min-width: 100%;
  }
}
@media (max-width: 480px) {
  .topbar {
    gap: 4px 6px;
  }
  .brand {
    gap: 6px;
  }
  .top-actions {
    display: contents;
  }
  .toolbar {
    margin-right: auto;
  }
  .toolbar button {
    padding-inline: 8px;
  }
  .top-actions > button,
  .file-picker {
    order: 3;
  }
  .file-picker {
    position: static;
  }
  .file-menu {
    right: 12px;
  }
  .save-state {
    order: 4;
    flex-basis: 100%;
    max-width: 100%;
    font-size: 10px;
    line-height: 16px;
  }
  .selection-tools > button {
    padding-inline: 8px;
  }
  .connect-message {
    padding: 8px 10px;
    font-size: 11px;
  }
}
@media (pointer: coarse) {
  .topbar button,
  .selection-tools > button,
  .popup-menu > button,
  .zoom button {
    min-height: 44px;
  }
  .mcp-panel button,
  .mcp-permission select,
  .mcp-configuration summary {
    min-height: 44px;
  }
  .toolbar button,
  #board-menu-toggle,
  .zoom button {
    min-width: 44px;
  }
  .palette {
    gap: 6px;
    padding-inline: 0;
  }
  .swatch {
    width: 36px;
    height: 36px;
  }
  .card-menu {
    width: 188px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
