/* ===== Property Panel ===== */
#propertyPanel {
  position: fixed;
  right: calc(-1 * var(--property-panel-w));  /* 默认隐藏 */
  top: 0;
  bottom: 0;
  width: var(--property-panel-w);
  background: rgba(32, 35, 42, 0.94);
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  color: #d7dde6;
  overflow-y: auto;
  z-index: 100;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.4);
}

#propertyPanel.open {
  right: 0;  /* 打开时显示 */
}

#propertyPanel .panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

#propertyPanel .panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #e9eef7;
}

#propertyPanel .panel-section {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#propertyPanel .section-title {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: #e9eef7;
  display: flex;
  align-items: center;
  gap: 8px;
}

#propertyPanel .section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  background: rgba(46, 140, 255, 0.8);
  border-radius: 2px;
}

#propertyPanel .prop-group {
  margin-bottom: 16px;
}

#propertyPanel .prop-group:last-child {
  margin-bottom: 0;
}

#propertyPanel .prop-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: rgba(215, 221, 230, 0.9);
  font-weight: 500;
}

#propertyPanel .prop-checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

#propertyPanel .prop-checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}

#propertyPanel .prop-checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: rgba(46, 140, 255, 0.8);
}

#propertyPanel input[type="text"],
#propertyPanel input[type="number"],
#propertyPanel select,
#propertyPanel textarea {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e9eef7;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  transition: all 0.2s;
}

#propertyPanel input[type="text"]:focus,
#propertyPanel input[type="number"]:focus,
#propertyPanel select:focus,
#propertyPanel textarea:focus {
  outline: none;
  border-color: rgba(46, 140, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
}

#propertyPanel input[type="text"]:disabled,
#propertyPanel input[type="number"]:disabled,
#propertyPanel select:disabled,
#propertyPanel textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#propertyPanel textarea {
  resize: vertical;
  min-height: 60px;
}

#propertyPanel select option {
  background: rgba(32, 35, 42, 0.98);
  color: #e9eef7;
  padding: 8px;
}

#propertyPanel .prop-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

#propertyPanel .prop-row > * {
  flex: 1;
}

#propertyPanel .prop-row .prop-label {
  flex: 0 0 auto;
  margin-bottom: 0;
  min-width: 60px;
}

/* Color picker */
#propertyPanel input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

#propertyPanel input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

#propertyPanel input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

/* Range slider */
#propertyPanel input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

#propertyPanel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(46, 140, 255, 0.9);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#propertyPanel input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(46, 140, 255, 0.9);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#propertyPanel .range-value {
  display: inline-block;
  min-width: 40px;
  text-align: right;
  font-size: 12px;
  color: rgba(215, 221, 230, 0.8);
  font-weight: 500;
}

#propertyPanel .prop-flex {
  display: flex;
  gap: 8px;
  align-items: center;
}

#propertyPanel .prop-flex input[type="range"] {
  flex: 1;
}

/* Line style selector */
#propertyPanel .line-style-selector {
  display: flex;
  gap: 8px;
}

#propertyPanel .line-style-option {
  flex: 1;
  padding: 8px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

#propertyPanel .line-style-option:hover {
  border-color: rgba(46, 140, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

#propertyPanel .line-style-option.active {
  border-color: rgba(46, 140, 255, 0.8);
  background: rgba(46, 140, 255, 0.15);
}

#propertyPanel .line-style-preview {
  height: 3px;
  background: currentColor;
  margin-bottom: 6px;
}

#propertyPanel .line-style-option[data-style="dashed"] .line-style-preview {
  background: repeating-linear-gradient(
    to right,
    currentColor 0,
    currentColor 8px,
    transparent 8px,
    transparent 14px
  );
}

#propertyPanel .line-style-label {
  font-size: 11px;
  color: rgba(215, 221, 230, 0.8);
}
