/* 基础样式 */
html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

canvas {
  display: block;
}

/* 输入元素样式 */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #e5e7eb;
  border-radius: 4px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #1a1a1a;
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #1a1a1a;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* 表单元素样式 */
input[type="radio"],
input[type="checkbox"] {
  accent-color: #1a1a1a;
}

input[type="text"] {
  transition: border-color 0.15s ease;
}

input[type="text"]:focus {
  border-color: #1a1a1a;
}

/* 连线题样式 */
.matched {
  border-color: #10b981;
  background-color: #f0fdf4;
}

.matching-active {
  border-color: #3b82f6;
  background-color: #eff6ff;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

/* 按钮悬停效果 */
button {
  transition: all 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

button:active {
  transform: translateY(0);
}

/* 美化滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* 精致线条和微妙阴影 */
.section-divider {
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0)
  );
  margin: 2rem 0;
}

/* 交互状态 */
.interactive-element {
  transition: all 0.2s ease;
}

.interactive-element:hover {
  background-color: #f9fafb;
}

.interactive-element:active {
  background-color: #f3f4f6;
}
