* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft Yahei', 'SimHei', 'Heiti SC', Arial, sans-serif; background: #f7f7fb; color: #222; margin: 0; padding: 24px; overscroll-behavior-x: none; }
.container { max-width: 900px; margin: 0 auto; }
h1 { margin-top: 0; }
.collapsible-panel h3 { font-size: 16px; }
.mode-selection { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.mode-selection label { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 8px 12px; border-radius: 6px; background: #f8f9fa; }
.mode-selection label:hover { background: #e9ecef; }
.mode-selection input[type="radio"]:checked + * { font-weight: bold; }
.mode-selection label:has(input:checked) { background: #e3f2fd; border: 1px solid #2196f3; }
.difficulty-hint { margin: 8px 0; color: #666; font-size: 13px; }
.difficulty-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.difficulty-options label { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 8px 12px; border-radius: 6px; background: #f8f9fa; transition: all 0.2s; }
.difficulty-options label:hover { background: #e9ecef; }
.difficulty-options input[type="checkbox"]:checked + * { font-weight: bold; }
.difficulty-options label:has(input:checked) { background: #e3f2fd; border: 1px solid #2196f3; }
.difficulty-status { font-size: 13px; color: #333; background: #f0f8ff; padding: 8px; border-radius: 4px; border-left: 4px solid #2196f3; }
.scoreboard { background: #fff; padding: 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,0.05); margin-bottom: 20px; }
.score-info { display: flex; gap: 20px; margin-bottom: 12px; }
.score-item { display: flex; align-items: center; gap: 8px; }
.score-label { color: #666; font-weight: 600; }
.score-history { max-height: 200px; overflow-y: auto; font-family: monospace; font-size: 14px; background: #f8f9fa; padding: 8px; border-radius: 4px; }
.panels { display: flex; flex-direction: column; gap: 20px; }
.target-row { display: flex; gap: 12px; flex-wrap: wrap; }
.panel { background: #fff; padding: 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,0.05); }
.target-panel { flex: 1 1 150px; min-width: 120px; text-align: center; }
.target-panel .color-box { width: 100px; height: 100px; margin-left: auto; margin-right: auto; }
.user-color-panel { flex: 1 1 150px; min-width: 120px; text-align: center; }
.user-color-panel .color-box { width: 100px; height: 100px; margin-left: auto; margin-right: auto; }

/* 电脑端显示 - 大色块 */
@media (min-width: 768px) {
  .target-panel { flex: 1 1 300px; min-width: 250px; }
  .target-panel .color-box { width: 200px; height: 200px; }
  .user-color-panel { flex: 1 1 300px; min-width: 250px; }
  .user-color-panel .color-box { width: 200px; height: 200px; }
  .target-row { gap: 20px; }
}
.settings-panel { flex: 1 1 350px; min-width: 280px; transition: all 0.3s ease; }
.settings-panel.collapsed { flex: 0 0 auto; min-width: 0; }
.collapsible-panel { padding: 16px; transition: padding 0.3s ease; }
.collapsible-panel.collapsed { padding: 2px 16px; }
.collapsible-panel .panel-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; padding: 4px 8px; border-radius: 4px; transition: background-color 0.2s ease; margin: -4px -8px; }
.collapsible-panel.collapsed .panel-header { margin: 2px -8px; }
.collapsible-panel .panel-header:hover { background: #f8f9fa; }
.collapsible-panel .panel-header h3 { margin: 0; font-size: 15px; }
.collapsible-panel .toggle-icon { font-size: 14px; transition: transform 0.3s ease; }
.collapsible-panel.collapsed .toggle-icon { transform: rotate(-90deg); }
.collapsible-panel .panel-content { max-height: 1000px; overflow: hidden; transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease; opacity: 1; padding-top: 8px; margin-top: 4px; }
.collapsible-panel.collapsed .panel-content { max-height: 0; opacity: 0; padding-top: 0; margin-top: 0; padding-bottom: 0; margin-bottom: 0; }
.settings-section { margin-bottom: 16px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-section h4 { margin: 0 0 8px 0; font-size: 15px; color: #333; }
.controls-panel { width: 100%; }
.color-box { height: 140px; border-radius: 6px; border: 1px solid #e6e6ee; margin-bottom: 12px; position: relative; }
.color-box-large { height: 200px; }
.color-box-with-border { display: flex; align-items: center; justify-content: center; }
.color-box-inner { width: 60%; height: 60%; border-radius: 4px; }
.extra-difficulty { margin-top: 8px; border-top: 1px dashed #ddd; padding-top: 8px; }
.preview { outline: 2px solid rgba(0,0,0,0.06); }
.color-values { background: #f8f9fa; padding: 8px 12px; border-radius: 6px; margin-top: 12px; font-family: monospace; font-size: 12px; }
.diff-positive { color: #dc3545; font-weight: 600; }
.diff-negative { color: #28a745; font-weight: 600; }
.diff-item { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.diff-item .arrow { font-size: 12px; }
.diff-svg { display: inline-block; vertical-align: middle; margin-right: 6px; }
.diff-value { display: inline-block; }
.diff-exceed { font-weight: 800; background: rgba(255,235,59,0.18); padding: 2px 6px; border-radius: 4px; }
.value-row { display: flex; justify-content: space-between; margin: 4px 0; }
.value-label { color: #666; font-weight: 600; }
.value-row span:last-child { color: #333; }
.verification { font-size: 12px; border-top: 1px solid #e9ecef; padding-top: 4px; margin-top: 8px; }
.verification span:last-child { color: #28a745; }
.controls label { display: block; margin: 8px 0 4px; font-weight: 600; transition: all 0.3s ease; user-select: none; }
.controls input[type="range"] { width: 100%; touch-action: pan-y pinch-zoom; }
.controls { user-select: none; }

/* 被锁定的标签样式 */
.label-locked {
  color: #999 !important;
  text-decoration: line-through;
}

.label-locked::after {
  content: " (锁定)";
  color: #ff6b6b;
  font-size: 12px;
  font-weight: normal;
}
.hue-slider-container, .saturation-slider-container, .value-slider-container { position: relative; margin-bottom: 8px; transition: all 0.3s ease; }

/* 锁定状态的样式 */
.slider-locked {
  opacity: 0.4;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 4px;
  border: 2px dashed #ccc !important;
  position: relative;
}

.slider-locked::after {
  content: "🔒 已锁定";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 107, 107, 0.9);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider-locked input[type="range"] {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 色相滑块 */
.hue-slider { 
  width: 100%; 
  height: 20px; 
  -webkit-appearance: none; 
  appearance: none; 
  background: linear-gradient(to right, 
    hsl(0, 100%, 50%), 
    hsl(60, 100%, 50%), 
    hsl(120, 100%, 50%), 
    hsl(180, 100%, 50%), 
    hsl(240, 100%, 50%), 
    hsl(300, 100%, 50%), 
    hsl(360, 100%, 50%)
  ); 
  border-radius: 10px; 
  outline: none; 
}

/* 饱和度滑块 */
.saturation-slider { 
  width: 100%; 
  height: 20px; 
  -webkit-appearance: none; 
  appearance: none; 
  background: linear-gradient(to right, #808080, hsl(180, 100%, 50%)); 
  border-radius: 10px; 
  outline: none; 
}

/* 明度滑块 */
.value-slider { 
  width: 100%; 
  height: 20px; 
  -webkit-appearance: none; 
  appearance: none; 
  background: linear-gradient(to right, #000, hsl(180, 50%, 50%)); 
  border-radius: 10px; 
  outline: none; 
}

/* 通用滑块按钮样式 */
.hue-slider::-webkit-slider-thumb,
.saturation-slider::-webkit-slider-thumb,
.value-slider::-webkit-slider-thumb { 
  -webkit-appearance: none; 
  appearance: none; 
  width: 20px; 
  height: 20px; 
  border-radius: 50%; 
  background: #fff; 
  border: 2px solid #333; 
  cursor: pointer; 
}

.hue-slider::-moz-range-thumb,
.saturation-slider::-moz-range-thumb,
.value-slider::-moz-range-thumb { 
  width: 20px; 
  height: 20px; 
  border-radius: 50%; 
  background: #fff; 
  border: 2px solid #333; 
  cursor: pointer; 
}
.actions { display: flex; gap: 10px; }
button { background: #3b82f6; color: #fff; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
button:active { transform: translateY(1px); }
.result { margin-top: 18px; background: #fff; padding: 12px; border-radius: 8px; min-height: 225px; overflow-y: auto; box-shadow: 0 6px 20px rgba(0,0,0,0.05); }
.details { margin-top: 8px; font-family: monospace; white-space: pre-wrap; max-height: 400px; overflow-y: auto; font-size: 13px; line-height: 1.4; }
.color-preview { margin-top: 12px; }
.question-item { margin-bottom: 16px; padding: 8px; background: #f8f9fa; border-radius: 4px; }
.color-comparison { display: flex; gap: 12px; margin: 8px 0; align-items: center; }
.color-swatch { width: 40px; height: 40px; border-radius: 4px; border: 1px solid #ddd; }
.color-info { font-size: 12px; }
.color-label { font-weight: bold; margin-bottom: 2px; }
footer { margin-top: 18px; color: #666; }
