﻿/* 连接线、样式编辑、图库、历史记录与导出增强 */
.connection {
  stroke: #89978b;
  stroke-width: 3;
  pointer-events: stroke;
  cursor: pointer;
}
.connection:hover {
  stroke: #e58f72;
  stroke-width: 5;
}
.connection.preview {
  stroke-dasharray: 7 6;
  pointer-events: none;
}
.port {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #718b75;
  transform: translateY(-50%);
  z-index: 5;
  cursor: crosshair;
  box-shadow: 0 2px 6px #0002;
}
.port:hover,
.port.hot {
  width: 18px;
  height: 18px;
  background: #718b75;
}
.port.left {
  left: -8px;
}
.port.right {
  right: -8px;
}
.layer-row {
  transition: 0.18s;
}
.layer-row.dragging {
  opacity: 0.35;
}
.layer-row.drop-before {
  transform: translateY(4px);
  border-top: 3px solid #e58f72;
}
.drag-grip {
  color: #999;
  font-size: 18px;
  cursor: grab;
  text-align: center;
  touch-action: none;
}
.drag-grip:active {
  cursor: grabbing;
}
.layer-ghost {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  display: grid;
  grid-template-columns: 28px 1fr 25px;
  align-items: center;
  gap: 7px;
  padding: 10px 8px;
  background: #fffdf8;
  border: 1px solid #718b75;
  border-radius: 11px;
  box-shadow: 0 12px 30px #25312c33;
  font-size: 12px;
  transform: scale(1.02);
}
.inspector-empty {
  font-size: 12px;
  color: #8a958e;
  background: #f0ede5;
  border-radius: 10px;
  padding: 12px;
  margin: 14px 0 18px;
}
.style-label {
  font-size: 12px;
  font-weight: 700;
  margin: 15px 0 9px;
}
.color-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.color-dot {
  width: 27px;
  height: 27px;
  border: 1px solid #d4d0c5;
  border-radius: 50%;
  cursor: pointer;
}
.color-dot.active {
  outline: 3px solid #718b7555;
  border-color: #718b75;
}
.font-select {
  width: 100%;
  border: 1px solid #ded9ce;
  border-radius: 9px;
  background: white;
  padding: 8px;
  margin-bottom: 9px;
  color: #24302b;
}
.format-row {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
}
.format-row button {
  width: 36px;
  height: 34px;
  border: 1px solid #ded9ce;
  border-radius: 8px;
  background: white;
  cursor: pointer;
}
.format-row button.active {
  background: #dfe8dc;
  border-color: #718b75;
}
.markdown-view {
  min-width: 170px;
  max-width: 270px;
  font-size: 13px;
  line-height: 1.6;
  color: #445149;
  user-select: text;
}
.markdown-view h1,
.markdown-view h2,
.markdown-view h3 {
  margin: 5px 0;
  font-family: Georgia, "Songti SC", serif;
}
.markdown-view h1 {
  font-size: 20px;
}
.markdown-view h2 {
  font-size: 17px;
}
.markdown-view h3 {
  font-size: 15px;
}
.markdown-view pre {
  overflow: auto;
  background: #26312d;
  color: #edf3ee;
  border-radius: 9px;
  padding: 10px;
  white-space: pre-wrap;
}
.markdown-view code {
  font-family: Consolas, monospace;
  background: #e8e5dd;
  border-radius: 4px;
  padding: 1px 4px;
}
.markdown-view pre code {
  background: transparent;
  padding: 0;
}
.markdown-view ul {
  margin: 3px 0;
  padding-left: 20px;
}
.node {
  max-width: none;
  min-width: 165px;
  min-height: 58px;
  width: 210px;
  resize: both;
  overflow: auto;
}
.node.collapsed {
  height: auto !important;
  resize: horizontal;
  overflow: visible;
}
.node-body {
  min-width: 0;
}
.node-note {
  max-width: 100%;
  min-height: 60px;
}
.node-actions {
  flex-wrap: wrap;
}
.node-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 7px;
  margin-top: 9px;
}
.node-thumb {
  height: 64px;
  min-width: 0;
  padding: 0;
  border: 1px solid #d8d4ca;
  border-radius: 9px;
  overflow: hidden;
  background: #ece9e0;
  cursor: zoom-in;
}
.node-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.lightbox[hidden] {
  display: none;
}
.lightbox {
  position: fixed;
  inset: 0;
  background: #17201ddb;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 40px;
}
.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 20px 70px #0008;
}
.lightbox-close {
  position: fixed;
  right: 25px;
  top: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #24302b;
  font-size: 28px;
  cursor: pointer;
}
.markdown-view {
  max-width: 100%;
}
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 76px;
  border: 0;
  border-radius: 15px;
  background: #fffdf0e8;
  color: #24302b;
  font-size: 45px;
  cursor: pointer;
}
.lightbox-nav.prev {
  left: 24px;
}
.lightbox-nav.next {
  right: 24px;
}
.lightbox-count {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 13px;
  border-radius: 20px;
  background: #fff;
  color: #24302b;
  font-size: 12px;
}
.canvas-item img,
.node img {
  -webkit-user-drag: none;
  user-select: none;
}
.text-item {
  border-width: 1.5px;
  padding: 10px;
  border-radius: 8px;
}
.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #65736b;
  margin: 9px 0 4px;
}
.range-control {
  width: 100%;
  accent-color: #718b75;
}
.control-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0;
}
.control-grid label {
  font-size: 10px;
  color: #65736b;
  text-align: center;
}
.control-grid input {
  display: block;
  width: 100%;
  height: 30px;
  border: 0;
  background: transparent;
  padding: 2px;
}
.history-panel {
  padding: 4px 0 14px;
  border-top: 1px solid #e1ddd3;
  border-bottom: 1px solid #e1ddd3;
  margin-bottom: 15px;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  color: #222c27;
  font-size: 11px;
  border-radius: 7px;
}
.history-row span {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dfe8dc;
  font-size: 9px;
}
.history-row.future {
  color: #a5aaa7;
}
.history-row.future span {
  background: #eeece6;
}
.layers {
  scrollbar-width: thin;
}
@media (max-width: 620px) {
  .lightbox-nav {
    width: 42px;
    height: 58px;
    font-size: 34px;
  }
  .lightbox-nav.prev {
    left: 8px;
  }
  .lightbox-nav.next {
    right: 8px;
  }
  .control-grid {
    grid-template-columns: 1fr;
  }
}
.text-drag-ghost {
  position: fixed;
  z-index: 3000;
  pointer-events: none;
  width: 180px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 2px dashed #718b75;
  border-radius: 10px;
  background: #ffffff80;
  color: #718b75;
  font-size: 12px;
  box-shadow: 0 8px 22px #25312c20;
}
.image-caption {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid #e2ded4;
  background: transparent;
  padding: 8px 6px 3px;
  outline: 0;
  text-align: center;
  color: #445149;
  font-size: 12px;
}
.image-item {
  min-width: 120px;
}
.image-item img {
  cursor: grab;
}
.image-item img:active {
  cursor: grabbing;
}
.history-wrap {
  position: relative;
}
.history-popover {
  position: absolute;
  right: 0;
  top: 48px;
  width: 230px;
  padding: 12px;
  background: #fffdf8;
  border: 1px solid #ded9ce;
  border-radius: 14px;
  box-shadow: 0 16px 42px #25312c28;
  z-index: 100;
}
.history-popover[hidden] {
  display: none;
}
.history-popover .style-label {
  margin: 2px 4px 8px;
}
.number-edit {
  width: 64px;
  border: 1px solid #d8d3c8;
  border-radius: 7px;
  background: #fff;
  padding: 4px 6px;
  text-align: right;
  color: #24302b;
}
.layer-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
  padding: 3px;
  border-radius: 5px;
}
.layer-name:hover {
  background: #f0ede5;
}
.layer-name-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #718b75;
  border-radius: 5px;
  padding: 3px;
  background: white;
  outline: 0;
  font-size: 12px;
}
.text-item textarea {
  width: 100%;
  height: 100%;
}
.text-draw-mode {
  cursor: crosshair !important;
}
.text-cursor {
  position: fixed;
  z-index: 3000;
  pointer-events: none;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #24302b;
  color: white;
  font:
    700 15px Georgia,
    serif;
  box-shadow: 0 5px 13px #0003;
}
.text-draw-rect {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
  min-width: 4px;
  min-height: 4px;
  border: 2px dashed #718b75;
  background: #ffffff80;
  border-radius: 8px;
}
.node-advanced {
  padding-top: 6px;
  border-top: 1px solid #e2ded4;
}
.export-wrap {
  position: relative;
}
.export-menu {
  position: absolute;
  right: 0;
  top: 48px;
  width: 140px;
  padding: 7px;
  background: #fffdf8;
  border: 1px solid #ded9ce;
  border-radius: 12px;
  box-shadow: 0 14px 35px #25312c24;
  z-index: 101;
}
.export-menu[hidden] {
  display: none;
}
.export-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 9px 10px;
  text-align: left;
  color: #24302b;
  cursor: pointer;
}
.export-menu button:hover {
  background: #dfe8dc;
}
@media (max-width: 900px) {
  .home {
    padding: 38px 24px 60px;
  }
  .hero h1 {
    font-size: 43px;
  }
  .new-btn {
    width: 96px;
    height: 96px;
    flex: none;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layers {
    position: absolute;
    right: 12px;
    top: 84px;
    bottom: 12px;
    width: 240px;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    background: rgba(250, 248, 243, 0.96);
  }
  .workspace {
    grid-template-columns: 68px 1fr;
  }
  .topbar {
    padding: 0 15px;
  }
}
@media (max-width: 620px) {
  .hero {
    align-items: flex-start;
    gap: 15px;
  }
  .hero h1 {
    font-size: 34px;
  }
  .hero p {
    display: none;
  }
  .new-btn {
    width: 75px;
    height: 75px;
    font-size: 12px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .section-head {
    margin-top: 38px;
  }
  .bar-title {
    display: none;
  }
  .layers {
    width: 205px;
    top: auto;
    height: 42vh;
  }
  .map-card {
    min-height: 180px;
  }
  .brand {
    font-size: 19px;
  }
  .topbar .primary {
    padding: 9px 12px;
  }
  .workspace {
    grid-template-columns: 58px 1fr;
  }
  .toolbar {
    padding: 12px 7px;
  }
  .tool {
    font-size: 10px;
  }
}
