/* ==========================================================================
   VecBridge 示例页共用样式（Tailwind 负责布局，本文件只承担结构性样式）
   供 playground / dxf-preview / svg-to-dxf / dom-to-dxf / canvas-record /
   browser-demo 共用。
   ========================================================================== */

html,
body {
  height: 100%;
}

/* ---------- 双引擎预览画布与 SVG 宿主 ---------- */
.vb-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
}
.vb-canvas:active {
  cursor: grabbing;
}

.vb-svg-host {
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
}
.vb-svg-host:active {
  cursor: grabbing;
}
.vb-svg-host > svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* 高保真 Visual SVG 纸张容器 */
.vb-visual-host {
  overflow: auto;
}
.vb-visual-host > svg {
  max-width: 100%;
  height: auto;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

/* ---------- 细滚动条 ---------- */
.vb-scroll {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.vb-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.vb-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.vb-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
.vb-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 分段控件（视图切换 / 标签切换 / 场景切换） ---------- */
.vb-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #f1f5f9;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 10px;
}
.vb-seg-btn {
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: #475569;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.vb-seg-btn:hover {
  color: #0f172a;
}
.vb-seg-btn.is-active {
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

/* 蓝色实心分段按钮（用于画布场景切换） */
.vb-seg-btn-solid.is-active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
}
.vb-seg-btn-solid.is-active:hover {
  color: #ffffff;
}

/* ---------- 通用按钮 / 表单控件 ---------- */
.vb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.vb-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.vb-btn:active {
  background: #f1f5f9;
}

.vb-btn-primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}
.vb-btn-primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
}

.vb-btn-teal {
  border-color: #0d9488;
  background: #0d9488;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(13, 148, 136, 0.25);
}
.vb-btn-teal:hover {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.vb-input,
.vb-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.vb-select {
  cursor: pointer;
}
.vb-input:focus,
.vb-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.vb-input::placeholder {
  color: #94a3b8;
}

.vb-check {
  width: 14px;
  height: 14px;
  accent-color: #2563eb;
  cursor: pointer;
}

.vb-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.7);
  color: #334155;
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.vb-textarea:focus {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* ---------- 可打印 DOM 样板（显式声明，避免 Tailwind Preflight 重置） ---------- */
.vb-sheet {
  width: 680px;
  padding: 18px 20px 18px 34px;
  position: relative;
  background: #ffffff;
  color: #111827;
  border: 2px solid #111827;
  font: 12px/1.5 "Microsoft YaHei", "SimSun", sans-serif;
}
.vb-sheet .vb-bind {
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  letter-spacing: 5px;
  font-size: 11px;
  color: #6b7280;
  padding: 10px 2px;
  border-right: 1px dashed #9ca3af;
}
.vb-sheet .vb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 3px double #111827;
}
.vb-sheet .vb-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #111827;
}
.vb-sheet .vb-sub {
  font-size: 11px;
  color: #4b5563;
  margin-top: 2px;
}
.vb-sheet .vb-pill {
  padding: 3px 10px;
  border-radius: 12px;
  background: #dcfce7;
  border: 1px solid #168f33;
  color: #168f33;
  font-size: 11.5px;
  font-weight: 700;
}
.vb-sheet .vb-ignore {
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: 4px;
  background: #fef3c7;
  border: 1px dashed #d97706;
  color: #92400e;
  font-size: 11px;
}
.vb-sheet table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  table-layout: fixed;
}
.vb-sheet th,
.vb-sheet td {
  border: 1px solid #111827;
  padding: 4px 6px;
  font-size: 11.5px;
  vertical-align: middle;
}
.vb-sheet th {
  background: #eef2f7;
  font-weight: 700;
  text-align: center;
}
.vb-sheet .vb-input {
  width: 100%;
  padding: 2px 5px;
  border: 1px solid #9ca3af;
  border-radius: 3px;
  font: inherit;
  color: #111827;
  background: #ffffff;
}
.vb-sheet .vb-card-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.vb-sheet .vb-box {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #6b7280;
  border-radius: 6px;
  background: #f9fafb;
}
.vb-sheet .vb-check-box {
  width: 195px;
  padding: 8px 10px;
  border: 1px solid #6b7280;
  border-radius: 6px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.vb-sheet ul {
  list-style-type: disc;
  margin: 4px 0 0;
  padding-left: 18px;
}
.vb-sheet ol {
  list-style-type: decimal;
  margin: 4px 0 0;
  padding-left: 18px;
}
.vb-sheet li {
  margin: 2px 0;
}
.vb-sheet hr {
  border: 0;
  border-top: 1px dashed #6b7280;
  margin: 8px 0;
}
.vb-sheet .vb-note {
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  font-size: 11px;
  color: #334155;
}
.vb-sheet [contenteditable]:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- 画布上的悬浮角标 ---------- */
.vb-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 10;
  pointer-events: none;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}
.vb-badge-blue {
  background: rgba(37, 99, 235, 0.9);
}
.vb-badge-teal {
  background: rgba(13, 148, 136, 0.9);
}

.vb-hint {
  position: absolute;
  bottom: 10px;
  right: 12px;
  z-index: 10;
  pointer-events: none;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: #475569;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
