html,
body {
  min-height: 100%;
}

.web-demo-app {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - 70px);
  background: #f5f2ea;
  color: #1d1d1d;
}

.web-demo-sidebar {
  border-right: 2px solid #222;
  background: #fffdf6;
  padding: 14px;
  overflow-y: auto;
}

.web-demo-brand h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

.web-demo-subtitle {
  margin-top: 4px;
  color: #666;
  font-size: 12px;
}

.web-demo-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 14px 0;
}

.web-demo-list-item {
  border: 2px solid #222;
  background: #fff;
  box-shadow: 3px 3px 0 #222;
  cursor: pointer;
  margin-bottom: 10px;
  padding: 9px 10px;
  transition: transform .12s ease, background-color .12s ease;
}

.web-demo-list-item:hover,
.web-demo-list-item.is-active {
  background: #ffe08a;
  transform: translate(-1px, -1px);
}

.web-demo-list-title {
  font-weight: 700;
  word-break: break-word;
}

.web-demo-list-meta {
  color: #666;
  font-size: 12px;
  margin-top: 3px;
}

.web-demo-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.web-demo-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  border-bottom: 2px solid #222;
  background: #fff;
  padding: 12px;
}

.web-demo-title-area label,
.web-demo-pd-area label {
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}

.web-demo-pd-area {
  min-width: 230px;
}

.web-demo-actions {
  display: flex;
  gap: 8px;
}

.simple-editor {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.simple-palette,
.simple-props {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid #222;
  background: #f8f8f8;
  padding: 8px 10px;
}

.simple-palette .btn,
.simple-props .btn {
  border-radius: 3px;
}

.simple-palette label {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin: 0 4px;
  font-size: 12px;
}

.wd-media-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  font-weight: 700;
  color: #666;
}

.wd-easymap-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef5ff;
  border: 2px dashed #3984ff !important;
  color: #3984ff;
  font-weight: 700;
  font-size: 18px;
}

.wd-box-input {
  background: transparent;
  padding: 5px;
}

.wd-box-input label {
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
}

.wd-page.has-grid {
  background-image: radial-gradient(#ccc 1px, transparent 1px);
  background-size: 20px 20px;
}

.web-demo-export-history {
  margin-top: 24px;
  border-top: 2px solid #222;
  padding-top: 14px;
}

.web-demo-export-history h3 {
  font-size: 16px;
  margin: 0 0 10px;
}

.export-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-item {
  border: 2px solid #222;
  background: #fff;
  padding: 6px;
  box-shadow: 3px 3px 0 #222;
}

.export-thumb {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #ddd;
  margin-bottom: 6px;
  cursor: zoom-in;
}

.export-meta {
  display: flex;
  justify-content: flex-end;
}

.simple-palette-sep {
  width: 1px;
  height: 28px;
  background: #888;
  margin: 0 4px;
}

.simple-props label {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin: 0 4px;
  font-size: 12px;
}

.simple-props input[type="color"] {
  width: 34px;
  height: 24px;
  border: 1px solid #555;
  padding: 0;
}

.simple-num {
  width: 76px;
  height: 24px;
  border: 1px solid #999;
  padding: 2px 4px;
}

.simple-stage-wrap {
  flex: 1 1 auto;
  overflow: auto;
  padding: 18px;
  background: #dedbd2;
  text-align: center;
}

.web-demo-viewer {
  flex: 1 1 auto;
  overflow: auto;
  background: #fff;
  padding: 18px;
}

.web-demo-empty {
  border: 2px dashed #999;
  color: #777;
  padding: 48px;
  text-align: center;
}

.wd-page {
  min-height: 760px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
  background: #fffdf7;
  color: #1f2328;
  font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
}

#simple_stage {
  outline: 0;
  position: relative;
  text-align: left;
}

.wd-edit-item {
  position: relative;
  cursor: pointer;
}

.wd-edit-item:hover {
  outline: 2px dashed #3984ff;
  outline-offset: 2px;
}

.wd-edit-item.is-selected {
  outline: 3px solid #ff6b00;
  outline-offset: 3px;
}

.wd-edit-item.wd-free {
  position: absolute;
  z-index: 10;
}

.wd-edit-item.wd-free.is-selected {
  cursor: move;
}

.ui-resizable-handle {
  background: #ff6b00;
  border: 1px solid #fff;
  width: 10px;
  height: 10px;
}

.ui-resizable-se {
  right: -7px;
  bottom: -7px;
}

.wd-sort-placeholder {
  min-height: 52px;
  margin: 12px 0;
  border: 2px dashed #ff6b00;
  background: rgba(255, 221, 128, .45);
}

.wd-context-menu {
  display: none;
  position: fixed;
  z-index: 99999;
  width: 178px;
  border: 2px solid #222;
  background: #fffdf6;
  box-shadow: 4px 4px 0 #222;
  padding: 6px;
}

.wd-context-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 14px;
  line-height: 1.25;
  padding: 7px 8px;
  text-align: left;
}

.wd-context-menu button:hover {
  background: #ffe08a;
}

.wd-context-row {
  display: grid;
  grid-template-columns: 1fr 58px 1fr;
  gap: 4px;
  align-items: center;
  margin: 2px 0;
}

.wd-context-row button {
  text-align: center;
  padding: 6px 4px;
}

.wd-context-row input {
  width: 58px;
  border: 1px solid #999;
  padding: 4px;
  text-align: center;
}

.wd-context-color-row {
  margin: 4px 0;
}

.wd-context-color-row label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  margin: 0;
  padding: 5px 8px;
}

.wd-context-color-row input[type="color"] {
  width: 34px;
  height: 24px;
  border: 1px solid #555;
  padding: 0;
}

.wd-context-chart-row {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 4px 0;
}

.wd-context-sep {
  border-top: 1px dashed #777;
  margin: 5px 0;
}

.wd-text-dialog {
  min-width: 360px;
  padding: 12px;
}

.wd-text-dialog h3 {
  margin: 0 0 10px;
}

.wd-text-dialog textarea {
  width: 100%;
  min-height: 160px;
  border: 2px solid #222;
  color: #111;
  padding: 8px;
}

.wd-text-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.wd-image-import-dialog {
  max-width: 560px;
  padding: 12px;
}

.wd-image-import-dialog h3 {
  margin: 0 0 10px;
}

.wd-image-import-dialog img {
  display: block;
  max-width: 520px;
  max-height: 340px;
  border: 2px solid #222;
  background: #fff;
  object-fit: contain;
}

.wd-image-import-dialog p {
  margin: 10px 0 0;
}

.wd-sketch {
  border: 2px solid #222;
  box-shadow: 4px 4px 0 #222;
  background: #fff;
}

.wd-box {
  min-height: 88px;
  padding: 16px;
  margin: 12px 0;
}

.wd-note {
  padding: 12px 14px;
  background: #fff7bc;
  border: 2px dashed #222;
}

.wd-tabs {
  margin: 12px 0;
}

.wd-tabs-nav {
  display: flex;
  gap: 6px;
}

.wd-tabs-nav div {
  border: 2px solid #222;
  border-bottom: 0;
  padding: 8px 12px;
  background: #f2f2f2;
  font-weight: 700;
}

.wd-tabs-body {
  border: 2px solid #222;
  padding: 16px;
  min-height: 90px;
}

.wd-line {
  border-top: 3px solid #222;
  margin: 18px 0;
}

.wd-line-v {
  border-top: 0;
  border-left: 3px solid #222;
  margin: 0;
}

.wd-reference-image {
  object-fit: fill;
}

.wd-user-image {
  display: block;
  object-fit: contain;
}

.wd-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  background: repeating-linear-gradient(45deg, #f7f7f7, #f7f7f7 10px, #ececec 10px, #ececec 20px);
  color: #777;
}

.wd-canvas-box {
  min-height: 180px;
  background: repeating-linear-gradient(-5deg, #fff, #fff 10px, #f5f5f5 11px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
}

.wd-canvas-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: contain;
  background: #fff;
}

.wd-draw-dialog {
  width: min(1160px, 94vw);
}

.wd-draw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.wd-draw-toolbar button,
.wd-draw-toolbar label {
  min-height: 34px;
}

.wd-draw-toolbar button {
  border: 1px solid #222;
  background: #fff;
  padding: 6px 10px;
  cursor: pointer;
}

.wd-draw-toolbar button.active,
.wd-draw-toolbar button.primary {
  background: #222;
  color: #fff;
}

.wd-draw-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.wd-draw-toolbar input[type="range"] {
  width: 120px;
}

.wd-draw-spacer {
  flex: 1 1 auto;
}

.wd-draw-canvas-wrap {
  overflow: auto;
  max-height: 78vh;
  border: 2px solid #222;
  background: #d7d7d7;
}

#wd_draw_canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.wd-chart {
  min-height: 260px;
  min-width: 160px;
  background: #f7fbff;
  overflow: hidden;
}

.wd-dark {
  background: #202124;
  color: #f3f3f3;
}

.wd-dark .wd-sketch,
.wd-dark.wd-sketch {
  background: #2c2f33;
  border-color: #f3f3f3;
  box-shadow: 4px 4px 0 #f3f3f3;
}

.wd-soft {
  background: #fbfaf4;
  color: #3a3327;
}

.wd-invert {
  filter: invert(1) hue-rotate(180deg);
}

@media (max-width: 900px) {
  .web-demo-app {
    grid-template-columns: 1fr;
  }

  .web-demo-sidebar {
    border-right: 0;
    border-bottom: 2px solid #222;
    max-height: 280px;
  }

  .web-demo-toolbar {
    grid-template-columns: 1fr;
  }

  .web-demo-actions {
    justify-content: flex-start;
  }
}
