/* 按钮和UI元素美化 */

/* 通用按钮样式 */
button, .button {
  background-color: var(--button-background);
  color: var(--text-color);
  border: 1px solid var(--block-border-color);
  border-radius: 8px;
  padding: 8px 15px;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

button:hover, .button:hover {
  background-color: var(--button-hover-background);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:active, .button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 波纹效果 */
button:after, .button:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(100, 100);
    opacity: 0;
  }
}

button:focus:not(:active)::after, .button:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

/* 主要按钮 */
.button-primary {
  background: linear-gradient(to right, var(--active-button-color), var(--button-hover-background));
  color: white;
  border: none;
}

.button-primary:hover {
  background: linear-gradient(to right, var(--button-hover-background), var(--active-button-color));
  box-shadow: 0 4px 12px rgba(207, 147, 230, 0.3);
}

/* 菜单按钮 */
.menu-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 10px 15px;
  transition: all 0.3s ease;
}

.menu-button i {
  margin-right: 8px;
  transition: all 0.3s ease;
}

.menu-button:hover i {
  transform: translateX(3px);
}

/* 工具提示 */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 120px;
  background-color: var(--block-background-color);
  color: var(--text-color);
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--block-border-color);
  font-size: 12px;
}

.tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--block-border-color) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* 开关按钮 */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--active-button-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--active-button-color);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* 滑块样式 */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: #e0e0e0;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--active-button-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
  width: 20px;
  height: 20px;
  box-shadow: 0 0 5px var(--active-button-color);
}

/* 按钮组 */
.button-group {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.button-group .button {
  border-radius: 0;
  flex: 1;
  margin: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.button-group .button:first-child {
  border-radius: 8px 0 0 8px;
}

.button-group .button:last-child {
  border-radius: 0 8px 8px 0;
  border-right: none;
}

/* 浮动操作按钮 */
.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--active-button-color);
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 20px;
  right: 20px;
  transition: all 0.3s ease;
  z-index: 1000;
}

.fab i {
  font-size: 24px;
}

.fab:hover {
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* 菜单列表项 */
.menu-list li {
  border-radius: 8px;
  margin-bottom: 2px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.menu-list li:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: translateX(5px);
}

.menu-list a {
  display: block;
  padding: 10px 15px;
  color: var(--text-color);
  text-decoration: none;
}

/* 可爱的复选框 */
.cute-checkbox {
  position: relative;
  padding-left: 30px;
  cursor: pointer;
  user-select: none;
}

.cute-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  background-color: #eee;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.cute-checkbox:hover input ~ .checkmark {
  background-color: #ccc;
}

.cute-checkbox input:checked ~ .checkmark {
  background-color: var(--active-button-color);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.cute-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.cute-checkbox .checkmark:after {
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
} 