/* ===== 全局重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "微软雅黑", "PingFang SC", "Helvetica Neue", sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

/* ===== 主布局 ===== */
#app {
  display: flex;
  height: 100vh;
}

/* ===== 左侧面板 ===== */
#left-panel {
  width: 320px;
  min-width: 320px;
  background: linear-gradient(to right, #1a1a2e, #16213e);
  border-right: 1px solid #2a2a4a;
  padding: 0 20px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#left-panel::-webkit-scrollbar {
  width: 4px;
}
#left-panel::-webkit-scrollbar-thumb {
  background: #3a3a5a;
  border-radius: 2px;
}
#left-panel::-webkit-scrollbar-track {
  background: transparent;
}

.panel-header {
  padding: 25px 0 5px;
}

.panel-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
}

.subtitle {
  font-size: 13px;
  color: #8888aa;
  margin-top: 4px;
  padding-bottom: 10px;
}

/* ===== 区块标题 ===== */
.section-title {
  color: #00d4ff;
  font-size: 13px;
  font-weight: 600;
  margin-top: 15px;
  margin-bottom: 10px;
  padding-left: 12px;
  border-left: 3px solid #00d4ff;
}

/* ===== 按钮 ===== */
.btn-primary {
  background: linear-gradient(to bottom, #00d4ff, #0099cc);
  border: none;
  border-radius: 10px;
  padding: 12px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  width: 100%;
}

.btn-primary:hover {
  background: linear-gradient(to bottom, #00e5ff, #00aadd);
}

.btn-primary:active {
  opacity: 0.85;
}

.btn-secondary {
  background: #2a2a4a;
  border: none;
  border-radius: 8px;
  padding: 8px;
  color: #e0e0e0;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}

.btn-secondary:hover:not(:disabled) {
  background: #353555;
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-lg {
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
}

#btn-save {
  margin-top: 10px;
}

/* ===== 信息标签 ===== */
.info-label {
  font-size: 12px;
  color: #8888aa;
  margin-top: 8px;
  padding: 8px 12px;
  background: #252545;
  border-radius: 6px;
  word-break: break-all;
}

/* ===== 文本框 ===== */
.text-input {
  width: 100%;
  background: #252545;
  border: 1px solid #3a3a5a;
  border-radius: 8px;
  padding: 10px 14px;
  color: white;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.text-input:focus {
  border-color: #00d4ff;
}

/* ===== 滑块 ===== */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #2a2a4a;
  border-radius: 3px;
  outline: none;
  margin: 8px 0;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #00d4ff;
  border: 2px solid #0099cc;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #00d4ff;
  border: 2px solid #0099cc;
  border-radius: 50%;
  cursor: pointer;
}

.slider:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.slider:disabled::-webkit-slider-thumb {
  cursor: not-allowed;
}

.slider-value {
  font-size: 12px;
  color: #8888aa;
  margin-top: 2px;
}

.accent {
  color: #00d4ff;
}

/* ===== 单选/复选框 ===== */
.radio-group {
  display: flex;
  gap: 20px;
  margin: 4px 0;
}

.radio-label {
  font-size: 13px;
  color: #e0e0e0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.radio-label input[type="radio"] {
  accent-color: #00d4ff;
}

.checkbox-label {
  font-size: 13px;
  color: #e0e0e0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.checkbox-label input[type="checkbox"] {
  accent-color: #00d4ff;
}

/* ===== 位置控制 ===== */
.pos-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
}

.pos-label {
  font-size: 12px;
  color: #8888aa;
  width: 24px;
  flex-shrink: 0;
}

.pos-row .slider {
  flex: 1;
}

.pos-val {
  font-size: 12px;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ===== 分隔线 ===== */
.separator {
  border: none;
  border-top: 1px solid #2a2a4a;
  margin: 20px 0;
}

/* ===== 右侧预览区 ===== */
#right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0f0f1a;
  min-width: 0;
}

.preview-header {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  padding: 20px;
  flex-shrink: 0;
}

#preview-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a15;
  position: relative;
  overflow: hidden;
}

#preview-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
}

#placeholder {
  font-size: 14px;
  color: #555577;
}

/* ===== 状态栏 ===== */
#status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 8px 16px;
  font-size: 12px;
  z-index: 100;
  display: none;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  #app {
    flex-direction: column;
  }
  #left-panel {
    width: 100%;
    min-width: unset;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid #2a2a4a;
  }
}
