/* 工具栏与 cloud-cb-design-tools/knit.html 同系：侧栏 300px、间距与表单控件一致 */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #ffffff;
  color: #000000;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.nav-bar {
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-content {
  width: 100%;
  margin: 0;
  max-width: none;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: relative;
}

.language-switcher {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}

.language-btn {
  padding: 0;
  background: transparent;
  border: none;
  font-size: 11px;
  color: #999999;
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: inherit;
  letter-spacing: 0;
  line-height: 1.4;
  text-decoration: none;
}

.language-btn:hover {
  color: #000000;
}

.language-btn.active {
  color: #000000;
  font-weight: 400;
}

.nav-logo {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: #000000;
  text-decoration: none;
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-logo-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
}

.nav-link {
  position: absolute;
  left: 240px;
  color: #000000;
  text-decoration: none;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.nav-link:hover {
  color: #666666;
}

.wrap {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - 49px);
}

aside {
  background: #ffffff;
  padding: 30px 24px 24px 24px;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

main {
  position: relative;
  background: #f9f9f9;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 40px 40px 40px;
  gap: 24px;
  flex-wrap: wrap;
}

h1 {
  font-size: 12px;
  font-weight: 400;
  color: #000000;
  margin-bottom: 10px;
  letter-spacing: 0;
  line-height: 1.5;
}

.description {
  font-size: 12px;
  color: #000000;
  line-height: 1.6;
  margin-bottom: 20px;
}

.controls-panel {
  padding-top: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.controls-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 0;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  font-size: 11px;
  color: #666666;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.4;
}

.control-value {
  font-size: 11px;
  color: #999999;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.row select {
  flex: 1;
  min-width: 0;
}

button {
  padding: 4px 8px;
  background: #f5f5f5;
  color: #000000;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  letter-spacing: 0;
  line-height: 1.4;
}

button:hover {
  background: #e0e0e0;
  border-color: #000000;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:disabled:hover {
  background: #f5f5f5;
  border-color: #e0e0e0;
}

button.primary {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

button.primary:hover:not(:disabled) {
  background: #333333;
  color: #ffffff;
}

button.primary:disabled:hover {
  background: #000000;
  border-color: #000000;
}

button.secondary {
  background: #f5f5f5;
  color: #000000;
  border-color: #e0e0e0;
}

button.secondary:hover:not(:disabled) {
  background: #e0e0e0;
  border-color: #000000;
}

select,
input[type="color"],
input[type="number"],
input[type="text"],
textarea {
  background: #fff;
  border: 1px solid #e0e0e0;
  color: #000000;
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}

input[type="file"] {
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  background: #f5f5f5;
  cursor: pointer;
  width: 100%;
}

.controls-panel input[type="number"] {
  width: 80px;
  max-width: 100%;
}

input[type="color"] {
  width: 40px;
  height: 24px;
  padding: 0;
  cursor: pointer;
  border: 1px solid #e0e0e0;
}

input[type="range"] {
  width: 100%;
  height: 2px;
  background: #e0e0e0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #000000;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #000000;
  cursor: pointer;
  border: none;
}

.tag {
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  color: #000000;
  background: #fff;
}

.badge {
  font-size: 11px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  padding: 2px 7px;
  color: #000000;
}

canvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: auto;
  height: auto;
}

canvas#canvas {
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.canvas-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.canvas-label {
  font-size: 11px;
  color: #666666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.canvas-stack {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.preview__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #666666;
  font-size: 12px;
  text-align: center;
  padding: 12px;
}

.preview__placeholder.hidden {
  display: none;
}

.preview__hint {
  font-size: 11px;
  color: #999999;
  margin-top: 8px;
  line-height: 1.5;
}

.preview__frame.preview__frame--drag .canvas-stack,
.canvas-container.preview__frame--drag .canvas-stack {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

.info-text {
  font-size: 11px;
  color: #999999;
  margin-top: 8px;
  line-height: 1.5;
}

.control-group .info-text {
  margin-top: 0;
}

.control-group .info-text + .info-text {
  margin-top: 4px;
}

.help-details {
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  padding: 8px 10px;
  background: #fff;
}

.help-details .help-body-text {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e0e0e0;
}

.help-details .help-body-text p {
  margin-top: 6px;
}

.help-details .help-body-text p:first-child {
  margin-top: 0;
}

.help-summary-fix {
  list-style: none;
  cursor: pointer;
}

.help-summary-fix::-webkit-details-marker {
  display: none;
}

.copyright-info {
  margin-top: auto;
  padding-top: 32px;
  font-size: 11px;
  color: #666666;
  line-height: 1.6;
}

.copyright-text {
  margin-bottom: 8px;
}

.icp-number {
  font-size: 11px;
  color: #666666;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #000000;
}

label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: #000000;
}

.control-group > .control-label {
  cursor: default;
}

.param-hidden-ui[hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  .nav-content {
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-link {
    position: static;
    left: auto;
  }

  .nav-bar {
    padding: 10px 16px;
  }

  .wrap {
    grid-template-columns: 1fr;
  }

  aside {
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 18px 16px 16px 16px;
    max-height: none;
  }

  main {
    padding: 18px 16px 24px 16px;
  }

  .canvas-container {
    width: 100%;
  }

  canvas {
    width: 100%;
    height: auto;
    max-height: none;
  }
}
