﻿/* 基础变量与全局重置 */
:root {
  --ink: #24302b;
  --muted: #718078;
  --paper: #f4f0e7;
  --card: #fffdf8;
  --line: #d9d5c9;
  --sage: #718b75;
  --sage2: #dfe8dc;
  --coral: #e58f72;
  --gold: #e3b65d;
  --blue: #7c9eb2;
  --shadow: 0 18px 55px rgba(54, 62, 52, 0.12);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--paper);
  overflow: hidden;
}
button,
input,
textarea {
  font: inherit;
}
.app {
  height: 100vh;
}
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(70, 80, 70, 0.12);
  background: rgba(250, 248, 242, 0.88);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 2px;
}
.brand-mark {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  background: var(--ink);
  display: grid;
  place-items: center;
  color: white;
}
.brand-mark svg {
  width: 20px;
}
.bar-title {
  margin-left: auto;
  margin-right: auto;
  font-weight: 600;
}
.icon-btn,
.primary,
.soft-btn {
  border: 0;
  cursor: pointer;
  transition: 0.2s;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--ink);
}
.icon-btn:hover {
  background: #e8e5dc;
}
.icon-btn svg {
  width: 20px;
}
.primary {
  padding: 11px 18px;
  border-radius: 13px;
  background: var(--ink);
  color: white;
  box-shadow: 0 7px 16px rgba(36, 48, 43, 0.2);
}
.primary:hover {
  transform: translateY(-1px);
}
/* 首页与导图卡片 */
.home {
  height: calc(100vh - 72px);
  overflow: auto;
  padding: 60px max(6vw, 30px) 80px;
  background:
    radial-gradient(circle at 85% 0%, #e4eadd 0, transparent 30%), var(--paper);
}
.hero {
  max-width: 1180px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.eyebrow {
  color: var(--sage);
  font-weight: 700;
  letter-spacing: 3px;
  font-size: 12px;
}
.hero h1 {
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.06;
  margin: 12px 0 14px;
  max-width: 680px;
  font-weight: 500;
}
.hero p {
  color: var(--muted);
  font-size: 16px;
}
.new-btn {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 0;
  background: var(--coral);
  color: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 18px 35px rgba(229, 143, 114, 0.28);
  font-weight: 700;
}
.new-btn span {
  font-size: 30px;
  font-weight: 300;
}
.section-head {
  max-width: 1180px;
  margin: 65px auto 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-head h2 {
  font:
    500 25px Georgia,
    "Songti SC",
    serif;
  margin: 0;
}
.count {
  font-size: 13px;
  color: var(--muted);
}
.grid {
  max-width: 1180px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}
.map-card {
  position: relative;
  min-height: 210px;
  padding: 24px;
  background: var(--card);
  border: 1px solid rgba(75, 75, 60, 0.12);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(60, 65, 50, 0.07);
  cursor: pointer;
  overflow: hidden;
  transition: 0.25s;
}
.map-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}
.card-accent {
  position: absolute;
  width: 125px;
  height: 125px;
  border-radius: 50%;
  right: -35px;
  top: -40px;
  opacity: 0.25;
}
.map-card h3 {
  font-size: 21px;
  margin: 40px 0 8px;
}
.map-card p {
  font-size: 13px;
  color: var(--muted);
}
.card-foot {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dots {
  display: flex;
}
.dots i {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 2px solid white;
  margin-left: -5px;
}
.delete-card {
  opacity: 0;
  position: absolute;
  right: 16px;
  bottom: 15px;
  background: #fff;
  border: 0;
  border-radius: 9px;
  padding: 7px;
  color: #a96356;
  cursor: pointer;
}
.map-card:hover .delete-card {
  opacity: 1;
}
/* 画板、工具栏、节点与图层面板 */
.workspace {
  height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 78px 1fr 280px;
}
.toolbar {
  background: #f8f5ee;
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  z-index: 10;
}
.tool {
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: 10px 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.tool:hover,
.tool.active {
  background: var(--sage2);
  color: var(--ink);
}
.tool svg {
  width: 22px;
  height: 22px;
}
.canvas-wrap {
  position: relative;
  overflow: hidden;
  background-color: #eeece4;
  background-image: radial-gradient(#c9c7be 1px, transparent 1px);
  background-size: 22px 22px;
}
.canvas {
  position: absolute;
  width: 2400px;
  height: 1600px;
  transform-origin: 0 0;
}
.connections {
  position: absolute;
  inset: 0;
  width: 2400px;
  height: 1600px;
  overflow: visible;
  pointer-events: none;
}
.connection {
  fill: none;
  stroke: #9fa99e;
  stroke-width: 2;
}
.node {
  position: absolute;
  min-width: 165px;
  max-width: 300px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid rgba(70, 75, 65, 0.14);
  box-shadow: 0 9px 24px rgba(55, 60, 50, 0.13);
  padding: 14px 16px;
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.2s;
}
.node.selected {
  outline: 3px solid rgba(113, 139, 117, 0.27);
  box-shadow: 0 12px 30px rgba(55, 70, 60, 0.2);
}
.node.collapsed .node-body {
  display: none;
}
.node-head {
  display: flex;
  gap: 8px;
  align-items: center;
}
.node-title {
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 700;
  min-width: 100px;
  width: 100%;
  color: var(--ink);
}
.collapse {
  border: 0;
  background: var(--sage2);
  width: 25px;
  height: 25px;
  border-radius: 8px;
  cursor: pointer;
  flex: none;
}
.node-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.node-note {
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  width: 100%;
  min-height: 44px;
  font-size: 13px;
  color: #536159;
}
.node-image {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 7px;
}
.node-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.mini {
  border: 0;
  border-radius: 8px;
  padding: 6px 9px;
  background: #efede5;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.canvas-item {
  position: absolute;
  cursor: grab;
}
.text-item {
  min-width: 160px;
  padding: 10px;
  border: 1px dashed transparent;
}
.text-item.selected {
  border-color: var(--sage);
}
.text-item textarea {
  border: 0;
  background: transparent;
  resize: none;
  outline: 0;
  font:
    600 22px Georgia,
    "Songti SC",
    serif;
  color: var(--ink);
  width: 220px;
  min-height: 70px;
}
.image-item {
  padding: 6px;
  background: white;
  border-radius: 13px;
  box-shadow: 0 8px 20px rgba(45, 50, 45, 0.15);
}
.image-item img {
  display: block;
  max-width: 300px;
  max-height: 240px;
  border-radius: 9px;
}
.image-item.selected {
  outline: 3px solid rgba(113, 139, 117, 0.4);
}
.layers {
  background: #faf8f3;
  border-left: 1px solid var(--line);
  padding: 21px 18px;
  overflow: auto;
  z-index: 10;
}
.layers h3 {
  margin: 5px 0 6px;
  font:
    600 20px Georgia,
    "Songti SC",
    serif;
}
.layers .hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}
.layer-row {
  display: grid;
  grid-template-columns: 28px 1fr 25px;
  align-items: center;
  gap: 7px;
  padding: 10px 8px;
  margin-bottom: 7px;
  background: white;
  border: 1px solid #ebe7dd;
  border-radius: 11px;
  cursor: pointer;
  font-size: 12px;
}
.layer-row.active {
  border-color: var(--sage);
  background: var(--sage2);
}
.drag-grip {
  color: #aaa;
  letter-spacing: -2px;
}
.layer-actions {
  display: flex;
  gap: 7px;
  margin-top: 18px;
}
.soft-btn {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  background: #e9e6dd;
  color: var(--ink);
  font-size: 12px;
}
.zoom {
  position: absolute;
  bottom: 22px;
  left: 24px;
  z-index: 11;
  display: flex;
  align-items: center;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 18px #0001;
  overflow: hidden;
}
.zoom button {
  border: 0;
  background: white;
  padding: 9px 12px;
  cursor: pointer;
}
.zoom span {
  font-size: 12px;
  min-width: 48px;
  text-align: center;
}
.empty {
  padding: 80px;
  text-align: center;
  color: var(--muted);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #25312c;
  color: white;
  padding: 11px 18px;
  border-radius: 12px;
  z-index: 99;
  animation: toast 2.2s forwards;
}
@keyframes toast {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  15%,
  80% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
  }
}
@media (max-width: 850px) {
  .layers {
    position: absolute;
    right: 0;
    top: 72px;
    bottom: 0;
    width: 250px;
  }
  /* 画板、工具栏、节点与图层面板 */
  .workspace {
    grid-template-columns: 70px 1fr;
  }
  .hero {
    align-items: flex-start;
  }
  .new-btn {
    width: 100px;
    height: 100px;
  }
  /* 首页与导图卡片 */
  .home {
    padding-top: 35px;
  }
}
