.ai-mind-workbench {
  width: min(100% - 48px, 1500px) !important;
  margin: 34px auto 52px !important;
}

.ai-mind-workbench,
.ai-mind-workbench * {
  box-sizing: border-box;
}

.ai-mind-page {
  overflow: auto !important;
}

.mind-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.mind-titlebar span {
  display: inline-flex;
  height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  color: #1c65e8;
  background: #edf5ff;
  font-size: 12px;
  font-weight: 760;
}

.mind-titlebar h1 {
  margin: 12px 0 8px;
  color: #071230;
  font-size: clamp(34px, 3.8vw, 56px);
  line-height: 1.06;
  letter-spacing: 0;
}

.mind-titlebar p {
  max-width: 880px;
  margin: 0;
  color: #62749a;
  font-size: 15px;
  line-height: 1.7;
}

.mind-status {
  display: grid;
  min-width: 126px;
  min-height: 78px;
  place-items: center;
  border: 1px solid rgba(195, 211, 240, 0.78);
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff, #f4f8ff);
  box-shadow: 0 18px 48px rgba(36, 76, 145, 0.1);
}

.mind-status b {
  color: #176dff;
  font-size: 28px;
  line-height: 1;
}

.mind-status small {
  color: #6d7f9f;
  font-size: 12px;
  font-weight: 720;
}

.mind-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.mind-control-panel,
.mind-main-panel,
.mind-node-editor,
.mind-outline,
.mind-tips {
  border: 1px solid rgba(201, 215, 240, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 60px rgba(31, 76, 154, 0.1);
}

.mind-control-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.mind-form,
.mind-editor-fields {
  display: grid;
  gap: 13px;
}

.mind-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mind-form label,
.mind-editor-fields label {
  display: grid;
  gap: 7px;
  color: #3f5a88;
  font-size: 13px;
  font-weight: 760;
}

.mind-form label.wide {
  grid-column: 1 / -1;
}

.mind-form input,
.mind-form select,
.mind-form textarea,
.mind-editor-fields input,
.mind-editor-fields textarea {
  width: 100%;
  border: 1px solid #bed1f3;
  border-radius: 12px;
  outline: 0;
  color: #081631;
  background: #fff;
  font: inherit;
  font-weight: 520;
}

.mind-form input,
.mind-form select,
.mind-editor-fields input {
  height: 40px;
  padding: 0 12px;
}

.mind-form textarea,
.mind-editor-fields textarea {
  min-height: 116px;
  padding: 12px;
  resize: vertical;
  line-height: 1.6;
}

.mind-form textarea {
  min-height: 150px;
}

.mind-upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mind-upload-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  min-height: 82px;
  border: 1px dashed #adc5f2;
  border-radius: 16px;
  padding: 13px 14px;
  background: linear-gradient(145deg, #fbfdff, #f2f7ff);
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.mind-upload-card:hover {
  transform: translateY(-1px);
  border-color: #1d72ff;
  background: #fff;
  box-shadow: 0 14px 34px rgba(29, 114, 255, 0.12);
}

.mind-upload-card.is-loading {
  border-style: solid;
  border-color: #7f91ff;
  background: linear-gradient(145deg, #f7fbff, #f6f3ff);
}

.mind-upload-card i {
  display: grid;
  grid-row: span 2;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #176dff, #7b61ff);
  box-shadow: 0 10px 24px rgba(54, 106, 236, 0.2);
  font-style: normal;
}

.mind-upload-card svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.mind-upload-card strong {
  min-width: 0;
  color: #0b1732;
  font-size: 14px;
  line-height: 1.25;
}

.mind-upload-card small {
  min-width: 0;
  overflow: hidden;
  color: #7283a2;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mind-form input:focus,
.mind-form select:focus,
.mind-form textarea:focus,
.mind-editor-fields input:focus,
.mind-editor-fields textarea:focus {
  border-color: #1d72ff;
  box-shadow: 0 0 0 4px rgba(29, 114, 255, 0.11);
}

.mind-actions,
.mind-editor-actions,
.mind-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mind-actions button,
.mind-editor-actions button,
.mind-toolbar button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  color: #34517f;
  background: #eef4ff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.mind-toolbar button.active {
  color: #fff;
  background: linear-gradient(135deg, #176dff, #7b61ff);
  box-shadow: 0 12px 30px rgba(31, 96, 220, 0.2);
}

.mind-actions button:hover,
.mind-editor-actions button:hover,
.mind-toolbar button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(31, 76, 154, 0.13);
}

.mind-actions .primary {
  color: #fff;
  background: linear-gradient(135deg, #156dff, #765cff);
  box-shadow: 0 14px 34px rgba(21, 109, 255, 0.22);
}

.mind-node-editor {
  padding: 16px;
  box-shadow: none;
}

.mind-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.mind-panel-head h2 {
  margin: 0;
  color: #081631;
  font-size: 17px;
}

.mind-panel-head span {
  color: #6b7e9f;
  font-size: 12px;
  font-weight: 720;
}

.mind-main-panel {
  overflow: hidden;
}

.ai-mind-workbench:fullscreen {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  margin: 0 !important;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f7faff;
}

.ai-mind-workbench:fullscreen .mind-titlebar,
.ai-mind-workbench:fullscreen .mind-control-panel,
.ai-mind-workbench:fullscreen .mind-bottom-grid {
  display: none;
}

.ai-mind-workbench:fullscreen .mind-layout {
  display: block;
  flex: 1;
  min-height: 0;
}

.ai-mind-workbench:fullscreen .mind-main-panel {
  display: flex;
  flex-direction: column;
  height: 100vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ai-mind-workbench:fullscreen .mind-canvas {
  flex: 1;
  min-height: 0;
}

.mind-toolbar {
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(222, 230, 244, 0.9);
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.mind-toolbar > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mind-toolbar span {
  min-width: 52px;
  color: #4a638f;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.mind-fullscreen-btn {
  width: 38px;
  padding: 0 !important;
  background: #f2f5fb !important;
}

.mind-fullscreen-btn svg {
  width: 18px;
  height: 18px;
  fill: #7a8495;
}

.mind-canvas {
  min-height: 610px;
  overflow: auto;
  padding: 36px;
  background:
    linear-gradient(rgba(85, 126, 205, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(85, 126, 205, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(35, 111, 255, 0.13), transparent 34%),
    #f7faff;
  background-size: 26px 26px, 26px 26px, auto, auto;
}

.mind-canvas.is-line-mode {
  cursor: crosshair;
}

.mind-canvas-board {
  position: relative;
  min-width: 1300px;
  min-height: 760px;
}

.mind-map-stage {
  position: relative;
  width: 1300px;
  height: 760px;
  transform-origin: center center;
  transition: transform 180ms ease;
}

.mind-line-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: visible;
  pointer-events: auto;
}

.mind-line-layer path {
  fill: none;
  stroke: #5f7cff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 7px 10px rgba(59, 95, 205, 0.16));
  cursor: pointer;
  pointer-events: stroke;
}

.mind-line-layer path.line-hit {
  stroke: transparent;
  stroke-width: 18;
  filter: none;
  pointer-events: stroke;
}

.mind-line-layer path.manual {
  stroke: #5f7cff;
  stroke-width: 3;
  filter: drop-shadow(0 7px 10px rgba(59, 95, 205, 0.16));
}

.mind-line-layer path.selected,
.mind-line-layer path.manual.selected {
  stroke: #ff8a00;
  stroke-width: 5;
  filter: drop-shadow(0 10px 18px rgba(255, 138, 0, 0.26));
}

.mind-line-layer path.draft {
  stroke-dasharray: 9 7;
  opacity: 0.78;
  pointer-events: none;
}

.mind-line-draft {
  stroke-dasharray: 8 7;
}

.mind-canvas-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(310px, 1fr) 260px minmax(310px, 1fr);
  gap: 34px;
  min-width: 980px;
  min-height: 520px;
  align-items: center;
  transform-origin: center center;
  transition: transform 180ms ease;
}

.mind-free-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.mind-free-item {
  position: absolute;
  display: grid;
  align-items: center;
  border: 1px solid rgba(180, 201, 236, 0.84);
  border-radius: 18px;
  padding: 13px 38px 13px 15px;
  color: #102247;
  background: var(--item-color, #fff);
  box-shadow: 0 16px 38px rgba(35, 72, 140, 0.12);
  cursor: grab;
  pointer-events: auto;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mind-free-handle {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 14px;
  height: 14px;
  border-radius: 5px;
  background:
    radial-gradient(circle, rgba(92, 112, 150, 0.58) 1.4px, transparent 1.5px) 0 0 / 6px 6px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.mind-free-item:hover .mind-free-handle,
.mind-free-item.active .mind-free-handle {
  opacity: 1;
}

.mind-free-item.text {
  align-items: start;
  border-color: transparent;
  padding: 5px 28px 5px 6px;
  color: var(--item-color, #176dff);
  background: transparent;
  box-shadow: none;
  font-size: 18px;
  font-weight: 850;
}

.mind-free-item:hover,
.mind-free-item.active {
  border-color: rgba(23, 109, 255, 0.74);
  box-shadow: 0 20px 46px rgba(31, 96, 220, 0.17);
}

.mind-free-item.dragging {
  cursor: grabbing;
  transform: scale(1.015);
}

.mind-free-text {
  min-height: 22px;
  outline: 0;
  color: inherit;
  line-height: 1.45;
  cursor: text;
  user-select: text;
  word-break: break-word;
}

.mind-free-item.card .mind-free-text {
  font-size: 15px;
  font-weight: 820;
}

.mind-free-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #60759b;
  background: rgba(235, 241, 251, 0.96);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.mind-free-delete:hover {
  color: #fff;
  background: #176dff;
}

.mind-center {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 190px;
  place-items: center;
  padding: 24px;
  border-radius: 36px;
  color: #fff;
  text-align: center;
  background: linear-gradient(145deg, #1677ff, #755cff 62%, #19c7b2);
  box-shadow: 0 28px 70px rgba(42, 103, 230, 0.28);
  cursor: grab;
}

.mind-center.dragging {
  cursor: grabbing;
}

.mind-center .mind-node-delete {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.18);
}

.mind-center:hover .mind-node-delete {
  opacity: 0.78;
}

.mind-center .mind-node-delete:hover {
  color: #fff;
  background: rgba(255, 77, 79, 0.86);
  opacity: 1;
}

.mind-map-stage > .mind-center {
  position: absolute;
  top: 300px;
  left: 515px;
  width: 270px;
  min-height: 170px;
}

.mind-center span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 760;
}

.mind-center strong {
  max-width: 220px;
  font-size: 28px;
  line-height: 1.18;
  outline: 0;
}

.mind-center small {
  max-width: 220px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.5;
  outline: 0;
}

.mind-center strong:focus,
.mind-center small:focus {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.mind-side {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mind-left {
  text-align: right;
}

.mind-right {
  text-align: left;
}

.mind-node {
  display: grid;
  gap: 10px;
}

.mind-node button {
  min-width: 0;
  border: 1px solid rgba(190, 209, 243, 0.86);
  border-radius: 18px;
  padding: 13px 15px;
  color: #102247;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 32px rgba(34, 69, 131, 0.08);
  text-align: inherit;
  cursor: pointer;
}

.mind-node button:hover,
.mind-node.active > button {
  border-color: rgba(29, 114, 255, 0.62);
  box-shadow: 0 18px 42px rgba(31, 96, 220, 0.13);
}

.mind-node b {
  display: block;
  font-size: 15px;
}

.mind-node span {
  display: block;
  margin-top: 5px;
  color: #657697;
  font-size: 12px;
  line-height: 1.45;
}

.mind-node ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 0 0 20px;
  list-style: none;
}

.mind-left .mind-node ul {
  padding: 0 20px 0 0;
}

.mind-node.depth-1 button {
  border-radius: 15px;
  background: #fbfdff;
}

.mind-node.depth-2 button,
.mind-node.depth-3 button {
  padding: 10px 12px;
  border-radius: 13px;
  box-shadow: none;
}

.mind-node-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.mind-line-delete {
  position: absolute;
  z-index: 7;
  transform: translate(-50%, -50%);
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(135deg, #ff8a00, #ff4d4f);
  box-shadow: 0 12px 26px rgba(255, 95, 31, 0.26);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.mind-line-delete:hover {
  transform: translate(-50%, -50%) translateY(-1px);
}

.mind-draggable-node {
  position: absolute;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid rgba(190, 209, 243, 0.88);
  border-radius: 18px;
  padding: 12px 14px;
  color: #102247;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 15px 34px rgba(34, 69, 131, 0.09);
  cursor: grab;
  pointer-events: auto;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mind-node-delete {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #33527f;
  background: rgba(235, 242, 255, 0.66);
  opacity: 0;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: opacity 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.mind-draggable-node:hover .mind-node-delete,
.mind-draggable-node.active .mind-node-delete {
  opacity: 0.72;
}

.mind-node-delete:hover {
  color: #fff;
  background: rgba(255, 77, 79, 0.86);
  opacity: 1;
  transform: scale(1.04);
}

.mind-draggable-node:hover,
.mind-draggable-node.active {
  border-color: rgba(29, 114, 255, 0.7);
  box-shadow: 0 18px 42px rgba(31, 96, 220, 0.15);
}

.mind-draggable-node.dragging {
  cursor: grabbing;
  transform: scale(1.015);
}

.mind-draggable-node.depth-1 {
  border-radius: 15px;
  background: #fbfdff;
}

.mind-draggable-node.depth-2,
.mind-draggable-node.depth-3 {
  padding: 10px 12px;
  border-radius: 13px;
  box-shadow: 0 10px 22px rgba(34, 69, 131, 0.06);
}

.mind-drag-handle {
  display: none;
}

.mind-node-title,
.mind-node-summary {
  outline: 0;
  word-break: break-word;
}

.mind-node-title {
  min-height: 21px;
  font-size: 15px;
  font-weight: 840;
}

.mind-node-summary {
  min-height: 18px;
  color: #657697;
  font-size: 12px;
  line-height: 1.45;
}

.mind-node-title:focus,
.mind-node-summary:focus {
  border-radius: 8px;
  background: rgba(237, 245, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(29, 114, 255, 0.09);
}

.mind-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  padding: 16px;
}

.mind-outline,
.mind-tips {
  padding: 16px;
  box-shadow: none;
}

.mind-outline article {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 50px;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  border-top: 1px solid rgba(222, 230, 244, 0.88);
}

.mind-outline b {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: #176dff;
  background: #edf5ff;
  font-size: 12px;
}

.mind-outline strong,
.mind-outline span {
  display: block;
}

.mind-outline strong {
  color: #102247;
  font-size: 14px;
}

.mind-outline span,
.mind-outline small,
.mind-tips li {
  color: #657697;
  font-size: 12px;
  line-height: 1.5;
}

.mind-tips ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mind-tips li {
  padding: 12px;
  border-radius: 14px;
  background: #f7faff;
}

.mind-empty-editor {
  color: #657697;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .ai-mind-workbench {
    width: min(100% - 32px, 980px) !important;
  }

  .mind-layout,
  .mind-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .mind-titlebar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mind-form-grid {
    grid-template-columns: 1fr;
  }
}
