/**
 * Checkbox 组件样式 - 100% 一比一复刻 MUI
 * 使用 CSS 伪元素实现三种状态图标
 * 
 * 对应 MUI: packages/mui-material/src/Checkbox/Checkbox.js
 */

/* =============================================
   Root 基础样式
   ============================================= */
.MuiCheckbox-root {
  color: rgba(0, 0, 0, 0.54);
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
  -webkit-tap-highlight-color: transparent;
}

.MuiCheckbox-root:hover {
  background-color: rgba(0, 0, 0, 0.04);
  border-radius: 50%;
}

/* =============================================
   Checkbox 图标 - 使用 CSS 实现
   ============================================= */
.MuiCheckbox-icon {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 2px;
  position: relative;
  transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
              background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}

/* =============================================
   Checked 状态 - 勾选图标
   ============================================= */
.MuiCheckbox-root.Mui-checked .MuiCheckbox-icon {
  background-color: currentColor;
  border-color: currentColor;
}

.MuiCheckbox-root.Mui-checked .MuiCheckbox-icon::after {
  content: '';
  position: absolute;
  display: block;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  left: 5px;
  top: 2px;
}

/* =============================================
   Indeterminate 状态 - 横线图标
   ============================================= */
.MuiCheckbox-root.MuiCheckbox-indeterminate .MuiCheckbox-icon {
  background-color: currentColor;
  border-color: currentColor;
}

.MuiCheckbox-root.MuiCheckbox-indeterminate .MuiCheckbox-icon::after {
  content: '';
  position: absolute;
  display: block;
  width: 10px;
  height: 2px;
  background-color: white;
  left: 4px;
  top: 8px;
}

/* =============================================
   尺寸变体
   ============================================= */
.MuiCheckbox-sizeSmall .MuiCheckbox-icon {
  width: 16px;
  height: 16px;
}

.MuiCheckbox-sizeSmall.Mui-checked .MuiCheckbox-icon::after {
  width: 4px;
  height: 8px;
  left: 4px;
  top: 2px;
  border-width: 0 1.5px 1.5px 0;
}

.MuiCheckbox-sizeSmall.MuiCheckbox-indeterminate .MuiCheckbox-icon::after {
  width: 8px;
  height: 1.5px;
  left: 4px;
  top: 7.5px;
}

/* =============================================
   颜色变体
   ============================================= */
.MuiCheckbox-colorPrimary {
  color: #1976d2;
}

.MuiCheckbox-colorPrimary.Mui-checked {
  color: #1976d2;
}

.MuiCheckbox-colorPrimary:hover {
  background-color: rgba(25, 118, 210, 0.04);
}

.MuiCheckbox-colorSecondary {
  color: #9c27b0;
}

.MuiCheckbox-colorSecondary.Mui-checked {
  color: #9c27b0;
}

.MuiCheckbox-colorSecondary:hover {
  background-color: rgba(156, 39, 176, 0.04);
}

.MuiCheckbox-colorError {
  color: #d32f2f;
}

.MuiCheckbox-colorError.Mui-checked {
  color: #d32f2f;
}

.MuiCheckbox-colorError:hover {
  background-color: rgba(211, 47, 47, 0.04);
}

.MuiCheckbox-colorInfo {
  color: #0288d1;
}

.MuiCheckbox-colorInfo.Mui-checked {
  color: #0288d1;
}

.MuiCheckbox-colorInfo:hover {
  background-color: rgba(2, 136, 209, 0.04);
}

.MuiCheckbox-colorSuccess {
  color: #2e7d32;
}

.MuiCheckbox-colorSuccess.Mui-checked {
  color: #2e7d32;
}

.MuiCheckbox-colorSuccess:hover {
  background-color: rgba(46, 125, 50, 0.04);
}

.MuiCheckbox-colorWarning {
  color: #ed6c02;
}

.MuiCheckbox-colorWarning.Mui-checked {
  color: #ed6c02;
}

.MuiCheckbox-colorWarning:hover {
  background-color: rgba(237, 108, 2, 0.04);
}

/* =============================================
   禁用状态
   ============================================= */
.MuiCheckbox-root.Mui-disabled {
  color: rgba(0, 0, 0, 0.26);
  cursor: default;
  pointer-events: none;
}

.MuiCheckbox-root.Mui-disabled:hover {
  background-color: transparent;
}

.MuiCheckbox-root.Mui-disabled .MuiCheckbox-icon {
  border-color: rgba(0, 0, 0, 0.26);
}

.MuiCheckbox-root.Mui-disabled.Mui-checked .MuiCheckbox-icon {
  background-color: rgba(0, 0, 0, 0.26);
  border-color: rgba(0, 0, 0, 0.26);
}

.MuiCheckbox-root.Mui-disabled.MuiCheckbox-indeterminate .MuiCheckbox-icon {
  background-color: rgba(0, 0, 0, 0.26);
  border-color: rgba(0, 0, 0, 0.26);
}

/* =============================================
   焦点状态（无障碍）
   ============================================= */
.MuiCheckbox-root:focus {
  outline: 2px solid #1976d2;
  outline-offset: 2px;
}
