:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #0b0b0b;
  --ink-soft: #2a2a2a;
  --muted: #6d6d6d;
  --line: rgba(12, 12, 12, 0.12);
  --line-strong: rgba(12, 12, 12, 0.22);
  --yellow: #ffdf2f;
  --yellow-soft: rgba(255, 223, 47, 0.22);
  --glass: rgba(255, 255, 255, 0.72);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --cursor-default: url("assets/shubiao-black.svg") 7 3, auto;
  --cursor-pointer: url("assets/shubiao-black.svg") 7 3, pointer;
  --cursor-grab: url("assets/shouzhang-black.svg") 12 12, grab;
  --cursor-grabbing: url("assets/shouzhang-black.svg") 12 12, grabbing;
  --cursor-crosshair: url("assets/shubiao-black.svg") 7 3, crosshair;
  --cursor-wait: url("assets/shubiao-black.svg") 7 3, wait;
  --cursor-not-allowed: url("assets/shubiao-black.svg") 7 3, not-allowed;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  height: 100%;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  cursor: var(--cursor-default);
  font-family:
    Inter,
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    Arial,
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: var(--cursor-pointer);
}

button:disabled {
  cursor: var(--cursor-wait);
}

[hidden] {
  display: none !important;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  isolation: isolate;
}

.toolbar {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-badge,
.icon-button,
.drawer-action,
.close-drawer,
.selection-head button,
.idea-button,
.canvas-controls,
.node-menu {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px) saturate(150%);
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.icon-button {
  min-width: 52px;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 900;
  transition:
    transform 180ms var(--ease),
    background 180ms var(--ease),
    border-color 180ms var(--ease);
}

.icon-button:hover,
.drawer-action:hover,
.close-drawer:hover,
.selection-head button:hover,
.idea-button:hover,
.canvas-controls button:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 0, 0, 0.28);
  background: rgba(255, 243, 147, 0.82);
}

.canvas {
  --grid-size: 44px;
  --grid-x: 0px;
  --grid-y: 0px;
  --pan-x: 50vw;
  --pan-y: 50vh;
  --zoom: 1;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(8, 8, 8, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 8, 8, 0.05) 1px, transparent 1px);
  background-position:
    var(--grid-x) var(--grid-y),
    var(--grid-x) var(--grid-y);
  background-size:
    var(--grid-size) var(--grid-size),
    var(--grid-size) var(--grid-size);
  cursor: var(--cursor-default);
  touch-action: none;
}

.canvas.is-panning {
  cursor: var(--cursor-grabbing);
}

.app.is-panning,
.app.is-panning .canvas,
.app.is-panning .word-node,
.app.is-panning button {
  cursor: var(--cursor-grabbing);
}

.canvas.is-selecting {
  cursor: var(--cursor-crosshair);
}

.canvas-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  transform: translate3d(var(--pan-x), var(--pan-y), 0) scale(var(--zoom));
  transform-origin: 0 0;
  will-change: transform;
}

.link-layer {
  position: absolute;
  left: -50000px;
  top: -50000px;
  z-index: 1;
  width: 100000px;
  height: 100000px;
  overflow: visible;
  pointer-events: none;
}

.word-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}


.image-preview-layer {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}

.image-preview-group {
  position: absolute;
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  gap: 10px;
  pointer-events: auto;
}

.image-preview-card,
.image-preview-skeleton,
.image-preview-empty {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
}

.image-preview-card {
  display: block;
  position: relative;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.image-preview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
}

.image-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-preview-card::after {
  content: attr(data-source);
  position: absolute;
  left: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(11, 11, 11, 0.74);
  color: #fff7c4;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-preview-skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.06), rgba(255,255,255,0.95), rgba(0,0,0,0.06));
  background-size: 220% 100%;
  animation: imageSkeleton 1.05s linear infinite;
}

.image-preview-empty {
  width: 308px;
  height: auto;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.image-preview-caption {
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 316px;
  color: rgba(0, 0, 0, 0.56);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
}

.image-preview-caption span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  background: rgba(255, 227, 82, 0.88);
  padding: 0 8px;
  color: #111111;
}

@keyframes imageSkeleton {
  0% { background-position: 0% 0; }
  100% { background-position: 220% 0; }
}

.word-link {
  stroke: rgba(0, 0, 0, 0.18);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  transition:
    opacity 220ms ease,
    stroke 220ms ease;
}

.word-link.is-selected {
  stroke: rgba(255, 205, 0, 0.72);
  stroke-width: 2;
}

.word-link.is-loading {
  stroke: rgba(255, 205, 0, 0.95);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 2 10;
  animation: dashFlow 760ms linear infinite;
}

.empty-signal {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: min(56vw, 540px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: 1;
  pointer-events: none;
  transition:
    opacity 320ms ease,
    transform 520ms var(--ease);
}

.empty-signal::before,
.empty-signal span {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1.5px solid rgba(0, 0, 0, 0.38);
  border-radius: 50%;
  opacity: 0;
  transform: translateZ(0) scale(0.58);
  animation: emptyRipple 3.6s linear infinite;
  will-change: transform, opacity;
}

.empty-signal::before {
  animation-delay: -1.8s;
}

.empty-signal span {
  animation-delay: 0s;
}

.app.has-map .empty-signal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72);
}

.home-title {
  position: fixed;
  left: 50%;
  top: calc(50% - 156px);
  z-index: 18;
  margin: 0;
  color: var(--ink);
  font-size: clamp(44px, 5vw, 76px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
  transition:
    opacity 320ms ease,
    transform 520ms var(--ease);
}

.app.has-map .home-title {
  opacity: 0;
  transform: translateX(-50%) translateY(-18px) scale(0.96);
}

.word-node {
  --scale: 1;
  --node-width: 152px;
  --node-min-height: 74px;
  --node-padding: 12px 18px 14px;
  --node-cn-size: 24px;
  --node-en-size: 13px;
  position: absolute;
  left: var(--screen-x);
  top: var(--screen-y);
  z-index: 4;
  display: grid;
  justify-items: center;
  align-content: center;
  width: var(--node-width);
  min-height: var(--node-min-height);
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 999px;
  padding: var(--node-padding);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.5)),
    rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 16px 35px rgba(0, 0, 0, 0.13);
  color: var(--ink);
  transform: translate(-50%, -50%) scale(var(--scale));
  transform-origin: center bottom;
  transition:
    transform 220ms var(--ease),
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
  backdrop-filter: blur(18px) saturate(140%);
  cursor: var(--cursor-pointer);
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.word-node::after {
  content: none;
}

.word-node:hover {
  --scale: 1.04;
  border-color: rgba(0, 0, 0, 0.38);
}

.word-node.is-root,
.word-node.is-active,
.word-node.is-picked {
  --scale: 1;
  --node-width: var(--node-picked-width);
  --node-min-height: var(--node-picked-min-height);
  --node-padding: var(--node-picked-padding);
  --node-cn-size: var(--node-picked-cn-size);
  --node-en-size: var(--node-picked-en-size);
  z-index: 8;
}

.word-node.is-root {
  border-color: rgba(0, 0, 0, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 24px 55px rgba(0, 0, 0, 0.16);
}

.word-node.is-picked {
  border-color: rgba(0, 0, 0, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 247, 168, 0.94), rgba(255, 220, 24, 0.86)),
    var(--yellow);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 20px 45px rgba(189, 145, 0, 0.25);
}

.word-node.is-picked::after {
  width: 58px;
  height: 58px;
  background: var(--yellow);
}

.word-node.is-active:not(.is-picked)::after,
.word-node.is-root::after {
  width: 52px;
  height: 52px;
  background: rgba(255, 219, 35, 0.56);
}

.word-node.is-loading {
  animation: nodePulse 1s ease-in-out infinite;
}

.word-node.is-loading::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(255, 208, 0, 0.8);
  border-right-color: transparent;
  border-radius: inherit;
  animation: spin 780ms linear infinite;
}

.word-node.is-jumping {
  animation: jumpShake 520ms var(--ease);
}

.word-node.is-dragging {
  cursor: var(--cursor-pointer);
  transition: none;
}

.word-cn {
  max-width: 100%;
  color: currentColor;
  font-size: var(--node-cn-size);
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-align: center;
}

.word-en {
  display: block;
  max-width: 100%;
  margin-top: 5px;
  color: rgba(0, 0, 0, 0.62);
  font-size: var(--node-en-size);
  font-weight: 760;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
}

.canvas-controls {
  position: fixed;
  left: 18px;
  top: 18px;
  z-index: 24;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  border-radius: 999px;
  padding: 5px;
}

.canvas-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.canvas-controls button img {
  width: 15px;
  height: 15px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.canvas-controls span {
  min-width: 50px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.selection-rect {
  position: fixed;
  z-index: 19;
  border: 1px solid rgba(0, 0, 0, 0.46);
  border-radius: 8px;
  background: rgba(255, 223, 47, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 223, 47, 0.48) inset;
  pointer-events: none;
}

.prompt-composer {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 22;
  width: min(650px, calc(100vw - 28px));
  transform: translate(-50%, -50%);
  transition:
    top 640ms var(--ease),
    width 420ms var(--ease),
    opacity 240ms ease;
}

.app.has-map .prompt-composer {
  top: calc(100vh - 58px);
  width: min(760px, calc(100vw - 28px));
}

.composer-glass {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.55)),
    rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 20px 50px rgba(0, 0, 0, 0.16);
  padding: 9px 10px 9px 24px;
  backdrop-filter: blur(22px) saturate(160%);
}

.composer-glass input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 850;
}

.composer-glass input::placeholder {
  color: rgba(0, 0, 0, 0.44);
}

.composer-glass button {
  min-width: 92px;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--yellow);
  font-size: 16px;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  transition:
    transform 180ms var(--ease),
    background 180ms ease,
    color 180ms ease;
}

.composer-glass button:hover {
  transform: translateY(-1px);
  background: var(--yellow);
  color: var(--ink);
}

.selection-panel {
  display: none !important;
  position: fixed;
  left: 18px;
  bottom: 108px;
  z-index: 20;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 36px));
  max-height: min(40vh, 380px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
  padding: 14px;
  backdrop-filter: blur(22px) saturate(145%);
}

.selection-head,
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selection-head strong,
.drawer-head strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 950;
}

.selection-head button,
.close-drawer {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 850;
}

.selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-list span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 34px;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  background: var(--yellow);
  padding: 6px 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.idea-button,
.drawer-action {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 950;
}

.idea-button {
  background: var(--ink);
  color: var(--yellow);
}

.idea-list {
  display: grid;
  gap: 10px;
}

.idea-overlay {
  position: fixed;
  inset: 0;
  z-index: 38;
  pointer-events: none;
}

.idea-float {
  position: absolute;
  top: 86px;
  right: 24px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(480px, calc(100vw - 40px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 132px);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(150%);
  pointer-events: auto;
  overflow: hidden;
  transition:
    width 0.22s ease,
    height 0.22s ease,
    max-height 0.22s ease,
    top 0.22s ease,
    right 0.22s ease,
    border-radius 0.22s ease,
    transform 0.22s ease;
}

.idea-float.is-dragging,
.idea-float.is-resizing {
  transition: none;
}

.idea-float.is-dragging .idea-float-head,
.idea-float.is-resizing .idea-float-head {
  cursor: grabbing;
}

.idea-float-head {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.idea-float-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.idea-drag-handle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: grab;
}

.idea-drag-handle img {
  width: 18px;
  height: 18px;
  display: block;
}

.idea-drag-handle:hover {
  border-color: rgba(0, 0, 0, 0.16);
  background: rgba(245, 214, 64, 0.18);
}

.idea-drag-handle:active {
  cursor: grabbing;
}

.idea-float-head strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
}

.idea-collapse-button,
.idea-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.idea-collapse-button {
  font-size: 18px;
}

.idea-collapse-button:hover,
.idea-close-button:hover {
  border-color: rgba(0, 0, 0, 0.22);
  background: var(--yellow);
}

.idea-float.is-collapsed {
  top: 50%;
  right: 0;
  width: 76px;
  height: 46px;
  max-height: 46px;
  transform: translateY(-50%);
  grid-template-rows: 1fr;
  border-right: 0;
  border-radius: 999px 0 0 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  overflow: hidden;
}

.idea-float.is-collapsed:hover {
  transform: translateY(-50%) translateX(-4px);
  background: rgba(255, 255, 255, 0.98);
}

.idea-float.is-collapsed .idea-float-head {
  height: 100%;
  justify-content: center;
  border-bottom: 0;
  padding: 0 14px 0 16px;
}

.idea-float.is-collapsed .idea-float-head strong {
  font-size: 0;
  line-height: 1;
}

.idea-float.is-collapsed .idea-float-head strong::after {
  content: "方案";
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.idea-float.is-collapsed .idea-float-head::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.idea-float.is-collapsed .idea-float-actions,
.idea-float.is-collapsed .idea-panel-body {
  display: none;
}

.idea-float.is-collapsed .idea-drag-handle,
.idea-float.is-collapsed .idea-resize-handle {
  display: none;
}

.idea-resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  z-index: 3;
}

.idea-resize-handle::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: rgba(245, 214, 64, 0.95);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.idea-float:hover .idea-resize-handle::before,
.idea-float.is-resizing .idea-resize-handle::before {
  opacity: 1;
  transform: scale(1);
}

.idea-resize-handle.is-nw {
  top: -8px;
  left: -8px;
  cursor: nwse-resize;
}

.idea-resize-handle.is-ne {
  top: -8px;
  right: -8px;
  cursor: nesw-resize;
}

.idea-resize-handle.is-sw {
  bottom: -8px;
  left: -8px;
  cursor: nesw-resize;
}

.idea-resize-handle.is-se {
  right: -8px;
  bottom: -8px;
  cursor: nwse-resize;
}

.idea-panel-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 14px;
}

.idea-panel-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.idea-panel-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 999px;
  background: var(--yellow);
  padding: 4px 10px;
  color: var(--ink);
}

.ppt-result {
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 252, 217, 0.94), rgba(255, 255, 255, 0.92)),
    rgba(255, 246, 154, 0.68);
  padding: 12px;
}

.ppt-result strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.35;
}

.ppt-result pre {
  max-height: 280px;
  overflow: auto;
  margin: 10px 0 0;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.06);
  padding: 10px;
  color: var(--ink-soft);
  font: 12px/1.55 Consolas, "Microsoft YaHei", monospace;
  white-space: pre-wrap;
}

.idea-card,
.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 249, 196, 0.72), rgba(255, 255, 255, 0.82)),
    rgba(255, 248, 174, 0.68);
  padding: 12px;
}

.idea-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.idea-card-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.idea-card-head strong,
.history-item strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.35;
}

.idea-card-head span {
  border-radius: 999px;
  background: #0b0b0b;
  color: var(--yellow);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 950;
  padding: 3px 7px;
}

.idea-card.is-refined,
.menu-idea-card.is-refined {
  border-color: rgba(0, 0, 0, 0.34);
  border-left: 5px solid #0b0b0b;
  background:
    linear-gradient(180deg, rgba(255, 226, 48, 0.34), rgba(255, 255, 255, 0.92)),
    rgba(255, 236, 88, 0.38);
}

.idea-card p,
.history-item p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.idea-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.idea-tags span {
  border-radius: 999px;
  background: rgba(255, 223, 47, 0.28);
  padding: 4px 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.idea-detail-button {
  min-height: 30px;
  border: 1px solid #0b0b0b;
  border-radius: 7px;
  background: #0b0b0b;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  margin-top: 10px;
  padding: 0 10px;
}

.ppt-button {
  min-height: 30px;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 7px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  padding: 0 10px;
}

.idea-card .idea-detail-button {
  width: 100%;
}

.idea-card.is-refined .idea-detail-button {
  width: auto;
}

.idea-detail-button:hover,
.ppt-button:hover {
  background: var(--yellow);
  color: var(--ink);
}

.ppt-button:hover {
  border-color: #0b0b0b;
  background: #0b0b0b;
  color: var(--yellow);
}

.idea-detail-button:disabled,
.ppt-button:disabled {
  cursor: var(--cursor-wait);
  opacity: 0.5;
}

.drawer {
  position: fixed;
  top: 72px;
  right: 18px;
  z-index: 34;
  width: min(390px, calc(100vw - 36px));
  max-height: calc(100vh - 98px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(22px) saturate(150%);
}

.node-menu {
  position: fixed;
  z-index: 42;
  display: grid;
  gap: 6px;
  width: min(320px, calc(100vw - 18px));
  max-height: min(72vh, 560px);
  overflow: auto;
  border-radius: 8px;
  padding: 8px;
}

.node-menu button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  text-align: left;
  padding: 0 10px;
}

.node-menu button:hover {
  background: var(--yellow);
}

.node-menu button:last-child:hover {
  background: #0b0b0b;
  color: var(--yellow);
}

.node-menu button:disabled {
  cursor: var(--cursor-not-allowed);
  opacity: 0.44;
}

.node-menu-divider {
  height: 1px;
  margin: 4px 2px;
  background: var(--line);
}

.node-menu-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 6px 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.4;
}

.node-menu-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  max-width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 999px;
  background: var(--yellow);
  padding: 3px 9px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.menu-idea-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.menu-idea-card {
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 201, 0.86), rgba(255, 255, 255, 0.92)),
    rgba(255, 243, 136, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 10px;
}

.menu-idea-card:nth-child(even) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 244, 161, 0.76)),
    rgba(255, 232, 88, 0.38);
}

.menu-idea-card .idea-card-head strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.35;
}

.menu-idea-card p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

.menu-idea-card .idea-detail-button {
  width: 100%;
}

.node-menu .idea-detail-button {
  border-color: #0b0b0b;
  background: #0b0b0b;
  color: var(--yellow);
}

.node-menu .idea-detail-button:hover {
  background: var(--yellow);
  color: var(--ink);
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.72);
  padding: 0 12px;
  color: var(--ink);
  font-weight: 760;
}

.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.72);
  padding: 0 12px;
  color: var(--ink);
  font-weight: 850;
}

.field input:focus,
.field select:focus {
  border-color: rgba(255, 204, 0, 0.8);
  box-shadow: 0 0 0 4px var(--yellow-soft);
}

.drawer-action {
  width: 100%;
  margin-top: 16px;
  background: var(--yellow);
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.settings-actions .drawer-action {
  margin-top: 0;
}


.drawer-action.ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.drawer-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.history-item {
  display: grid;
  gap: 9px;
}

.history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.history-item button {
  justify-self: start;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
  color: var(--yellow);
  padding: 0 13px;
  font-size: 13px;
  font-weight: 900;
}

.toast,
.loading-chip {
  position: fixed;
  left: 50%;
  z-index: 40;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 15, 15, 0.9);
  color: var(--yellow);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.toast {
  bottom: 104px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 850;
}

.loading-chip {
  top: 22px;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 900;
}

.empty-text {
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes nodePulse {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.94),
      0 16px 35px rgba(0, 0, 0, 0.13);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.94),
      0 18px 40px rgba(255, 207, 0, 0.38);
  }
}

@keyframes dashFlow {
  to {
    stroke-dashoffset: -24;
  }
}

@keyframes emptyRipple {
  0% {
    opacity: 0;
    transform: translateZ(0) scale(0.58);
  }
  12% {
    opacity: 0.52;
  }
  50% {
    opacity: 0.38;
    transform: translateZ(0) scale(1.16);
  }
  78% {
    opacity: 0.16;
    transform: translateZ(0) scale(1.38);
  }
  100% {
    opacity: 0;
    transform: translateZ(0) scale(1.46);
  }
}

@keyframes jumpShake {
  0% {
    transform: translate(-50%, -50%) scale(var(--scale)) rotate(0deg);
  }
  25% {
    transform: translate(-50%, -64%) scale(calc(var(--scale) + 0.08)) rotate(-2deg);
  }
  52% {
    transform: translate(-50%, -45%) scale(calc(var(--scale) + 0.03)) rotate(2deg);
  }
  76% {
    transform: translate(-50%, -56%) scale(calc(var(--scale) + 0.04)) rotate(-1deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(var(--scale)) rotate(0deg);
  }
}

@media (max-width: 820px) {
  .toolbar {
    top: 12px;
    right: 12px;
  }

  .mode-badge {
    display: none;
  }

  .canvas-controls {
    left: 12px;
    top: 12px;
  }

  .empty-signal {
    width: min(78vw, 360px);
  }

  .word-node {
    width: var(--node-width);
    min-height: var(--node-min-height);
    padding: var(--node-padding);
  }

  .word-node.is-root,
  .word-node.is-active,
  .word-node.is-picked {
    width: var(--node-picked-width);
    min-height: var(--node-picked-min-height);
  }

  .word-cn {
    font-size: var(--node-cn-size);
  }

  .word-en {
    font-size: var(--node-en-size);
  }

  .selection-panel {
    left: 12px;
    right: 12px;
    bottom: 98px;
    width: auto;
    max-height: 36vh;
  }

  .drawer {
    top: 64px;
    right: 12px;
    width: calc(100vw - 24px);
  }

  .idea-float {
    top: 64px;
    right: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 120px);
  }

  .idea-float.is-collapsed {
    top: auto;
    right: 0;
    bottom: 110px;
    width: 74px;
    height: 46px;
    max-height: 46px;
    transform: none;
  }

  .idea-float.is-collapsed:hover {
    transform: translateX(-4px);
  }

  .composer-glass {
    min-height: 64px;
    padding-left: 18px;
  }

  .composer-glass button {
    min-width: 78px;
    min-height: 48px;
  }

  .app.has-map .prompt-composer {
    top: calc(100vh - 50px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .empty-signal::before,
  .empty-signal::after,
  .empty-signal span {
    animation: none !important;
    opacity: 0.18;
    transform: scale(1);
  }

  .empty-signal span {
    transform: scale(0.72);
  }
}

.ppt-result.is-compact {
  display: grid;
  gap: 10px;
}

.ppt-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ppt-result-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #0b0b0b;
  color: var(--yellow);
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 950;
}

.ppt-result.is-compact p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
}

.ppt-result-actions {
  display: flex;
  gap: 8px;
}

.ppt-result-actions button {
  min-height: 32px;
  border-radius: 7px;
  background: #0b0b0b;
  color: var(--yellow);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 950;
}

.ppt-result details {
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  padding-top: 8px;
}

.ppt-result summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}


@media (max-width: 768px) {
  .idea-drag-handle {
    width: 32px;
    height: 32px;
  }

  .idea-resize-handle {
    width: 18px;
    height: 18px;
  }
}

.idea-float:not(.is-collapsed) .empty-text {
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px dashed rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  background: rgba(245, 214, 64, 0.08);
  color: var(--muted);
  font-weight: 850;
}

.idea-float:not(.is-collapsed):not(.is-custom-sized) {
  height: auto;
}


.field-hint {
  margin-top: 12px;
  color: rgba(0,0,0,0.52);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}


.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.68);
  backdrop-filter: blur(4px);
}

.image-lightbox-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 980px);
  max-height: min(88vh, 920px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: rgba(250, 249, 243, 0.98);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.32);
}

.image-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: #111;
  font-size: 28px;
  font-weight: 500;
  cursor: pointer;
}

.image-lightbox-close:hover {
  background: rgba(255, 226, 82, 0.82);
}

.image-lightbox-media-wrap {
  min-height: 180px;
  max-height: calc(88vh - 110px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
}

.image-lightbox-img {
  max-width: 100%;
  max-height: calc(88vh - 140px);
  display: block;
  object-fit: contain;
}

.image-lightbox-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.image-lightbox-title {
  flex: 1 1 240px;
  color: rgba(0, 0, 0, 0.74);
  font-size: 14px;
  line-height: 1.6;
  font-weight: 800;
}

.image-lightbox-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.image-lightbox-source,
.image-lightbox-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  background: #ffe352;
  color: #111;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.image-lightbox-source:hover,
.image-lightbox-open:hover {
  background: #ffd420;
}

@media (max-width: 680px) {
  .image-lightbox-dialog {
    width: min(94vw, 980px);
    padding: 14px;
    border-radius: 18px;
  }

  .image-lightbox-close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 24px;
  }

  .image-lightbox-meta {
    align-items: stretch;
  }
}





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

.uploaded-image-node {
  position: absolute;
  left: var(--screen-x);
  top: var(--screen-y);
  width: var(--screen-w);
  height: var(--screen-h);
  transform: translate(-50%, -50%);
  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

.uploaded-image-node:hover,
.uploaded-image-node.is-dragging,
.uploaded-image-node.is-resizing,
.uploaded-image-node.is-picked {
  border-color: rgba(255, 223, 47, 0.95);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.18), 0 0 0 2px rgba(255, 223, 47, 0.75);
}

.uploaded-image-node img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.uploaded-image-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: rgba(0, 0, 0, 0.82);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.uploaded-image-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.uploaded-image-node:hover .uploaded-image-actions,
.uploaded-image-node.is-dragging .uploaded-image-actions,
.uploaded-image-node.is-resizing .uploaded-image-actions,
.uploaded-image-node.is-picked .uploaded-image-actions {
  opacity: 1;
  transform: translateY(0);
}

.uploaded-image-action {
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.uploaded-image-action:hover {
  background: #ffdf2f;
  transform: none !important;
}

.uploaded-image-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: #ffdf2f;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: opacity 140ms ease;
}

.uploaded-image-node:hover .uploaded-image-handle,
.uploaded-image-node.is-resizing .uploaded-image-handle,
.uploaded-image-node.is-dragging .uploaded-image-handle,
.uploaded-image-node.is-picked .uploaded-image-handle {
  opacity: 1;
}

.uploaded-image-handle[data-direction="nw"] { left: 8px; top: 8px; cursor: nwse-resize; }
.uploaded-image-handle[data-direction="ne"] { right: 8px; top: 8px; cursor: nesw-resize; }
.uploaded-image-handle[data-direction="sw"] { left: 8px; bottom: 8px; cursor: nesw-resize; }
.uploaded-image-handle[data-direction="se"] { right: 8px; bottom: 8px; cursor: nwse-resize; }

.canvas.is-drop-target {
  box-shadow: inset 0 0 0 2px rgba(255, 223, 47, 0.75);
}

.image-menu {
  min-width: 184px;
}

@media (max-width: 640px) {
  .composer-upload-btn {
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    margin-left: 6px;
    font-size: 26px;
  }

  .uploaded-image-actions {
    gap: 4px;
  }

  .uploaded-image-action {
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }

  .uploaded-image-badge {
    left: 8px;
    bottom: 8px;
    font-size: 11px;
  }
}

.image-lightbox-backdrop {
  pointer-events: auto;
}

.image-lightbox-dialog {
  pointer-events: auto;
}

.image-lightbox-close {
  z-index: 5;
  pointer-events: auto;
}


.composer-glass .composer-upload-btn {
  position: relative;
  flex: 0 0 auto;
  min-width: 58px;
  width: 58px;
  min-height: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: #222;
  font-size: 28px;
  font-weight: 300;
  margin-left: -8px;
  margin-right: -2px;
}

.composer-glass .composer-upload-btn::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  background: transparent;
  transition: background 160ms ease;
}

.composer-glass .composer-upload-btn > span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.composer-glass .composer-upload-btn:hover,
.composer-glass .composer-upload-btn:focus-visible {
  background: transparent;
  color: #222;
  transform: none;
}

.composer-glass .composer-upload-btn:hover::before,
.composer-glass .composer-upload-btn:focus-visible::before {
  background: rgba(0, 0, 0, 0.08);
}

.uploaded-image-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(3px);
  pointer-events: none;
}

.uploaded-image-loading-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.84);
  color: #ffe352;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.uploaded-image-loading-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 227, 82, 0.32);
  border-top-color: #ffe352;
  animation: imageSpin 0.8s linear infinite;
}

@keyframes imageSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .composer-glass .composer-upload-btn {
    min-width: 52px;
    width: 52px;
    min-height: 52px;
    height: 52px;
    font-size: 26px;
  }
}
