/* VirtualKeyboard.css */
.virtual-keyboard {
  padding: 20px;
  font-family: Arial, sans-serif;
}

.hands {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  gap: 40px;
  align-items: center;
}

.hand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fingers {
  display: flex;
  gap: 10px;
}
/* 左手特定样式 */
.left-hand {
  flex-direction: row;
}

/* 右手特定样式 */
.right-hand {
  flex-direction: row;
}
/* 手指样式 */
.finger {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s ease;
  border: 2px solid rgba(0, 0, 0, 0.1);
}

/* 手指颜色对应 */
.finger.pinky {
  background-color: #FFE6E6;
  border-color: #FFB3B3;
}

.finger.ring {
  background-color: #FFF5E6;
  border-color: #FFE0B3;
}

.finger.middle {
  background-color: #E6FFE6;
  border-color: #B3FFB3;
}

.finger.index {
  background-color: #E6F3FF;
  border-color: #B3D9FF;
}

.finger.thumb {
  background-color: #FFFFFF;
  border-color: #CCCCCC;
}

/* 键位样式加强 */
.key {
  border: 2px solid rgba(0, 0, 0, 0.1);
}

.pink-key {
  background-color: #FFE6E6;
  border-color: #FFB3B3;
}

.beige-key {
  background-color: #FFF5E6;
  border-color: #FFE0B3;
}

.green-key {
  background-color: #E6FFE6;
  border-color: #B3FFB3;
}

.blue-key {
  background-color: #E6F3FF;
  border-color: #B3D9FF;
}

.default-key {
  background-color: #FFFFFF;
  border-color: #CCCCCC;
}

/* 激活状态的样式调整 */
.finger.active {
  background-color: #2196F3;
  border-color: #1976D2;
  color: white;
}

.key.active {
  background-color: #2196F3 !important;
  border-color: #1976D2 !important;
  color: white;
}

.finger.active {
  background-color: #2196F3;
  color: white;
}

.hand-label {
  font-size: 14px;
  color: #666;
  writing-mode: vertical-lr;
  text-orientation: upright;
  padding: 5px;
}


.keyboard {
  width: fit-content;
  margin: 0 auto;
  background-color: #f5f5f5;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.keyboard-row {
  display: flex;
  margin: 2px 0;
}

.key {
  position: relative;
  min-width: 40px; /* 基础键宽 */
  height: 40px;
  margin: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: all 0.2s ease;
  user-select: none;
  flex-grow: 0;
  flex-shrink: 0;
}
/* 添加宽度倍数类 */
.key[data-width="1"] { width: 40px; }
.key[data-width="1.25"] { width: 50px; }
.key[data-width="1.5"] { width: 60px; }
.key[data-width="1.75"] { width: 70px; }
.key[data-width="2"] { width: 80px; }
.key[data-width="2.25"] { width: 90px; }
.key[data-width="2.75"] { width: 120px; }
.key[data-width="6.25"] { width: 207px; }
.key[data-width="2.5"] { width: 95px; } 

.key.special-key {
  min-width: 60px;
}

.key.active {
  background-color: #2196F3 !important;
  color: white;
}

.pink-key {
  background-color: #FFE6E6;
}

.beige-key {
  background-color: #FFF5E6;
}

.green-key {
  background-color: #E6FFE6;
}

.blue-key {
  background-color: #E6F3FF;
}

.default-key {
  background-color: #FFFFFF;
}

.key-content {
  position: relative;
  width: 100%;
  height: 100%;
}

.upper-char {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 12px;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.lower-char {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 16px;
  transition: all 0.2s ease;
}

.upper-char.active {
  font-size: 16px;
  opacity: 1;
}

.lower-char.active {
  font-size: 16px;
  opacity: 1;
}

.lower-char:not(.active) {
  font-size: 12px;
  opacity: 0.6;
}

.key:not(.active) .upper-char,
.key:not(.active) .lower-char {
  color: #333;
}

.key.active .upper-char,
.key.active .lower-char {
  color: white;
  opacity: 1;
}

.main-char {
  font-size: 16px;
}

.special-key .main-char {
  font-size: 14px;
}