.car_overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9998;
}

.car_keyboard {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 480px;
  background: #fff;
  z-index: 9999;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.car_tab_bar {
  display: flex;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
  user-select: none;
}

.car_tab_btn {
  flex: 1;
  padding: 10px 0;
  font-size: 16px;
  cursor: pointer;
  border: none;
  background: none;
  color: #666;
  transition: color 0.3s ease, border-bottom 0.3s ease;
  border-bottom: 3px solid transparent;
}

.car_tab_btn.active {
  color: #007bff;
  border-bottom-color: #007bff;
}

.car_tab_btn:focus {
  outline: none;
  color: #0056b3;
  border-bottom-color: #0056b3;
}

.car_display {
  height: 70px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
  border-bottom: 1px solid #ddd;
  background: #f9f9f9;
  gap: 8px;
}

.car_province_selector,
.car_letter_selector {
  border: 1.5px solid #ccc;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 26px;
  font-size: 18px;
  background: #fff;
}

.car_selector_arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #666;
  transition: border-top-color 0.3s ease;
}

.car_province_selector:hover .car_selector_arrow,
.car_letter_selector:hover .car_selector_arrow {
  border-top-color: #007bff;
}

.car_selected_province,
.car_selected_letter {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.car_chars_container {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.car_char_input {
  width: 40px;
  height: 50px;
  font-size: 26px;
  text-align: center;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #333;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  position: relative;
  transition: border-color 0.3s ease;
}

.car_char_input.focused {
  border-color: #007bff !important;
}

.car_char_newenergy_last {
  border-color: #28a745 !important;
}

.car_char_input.empty::placeholder {
  color: #28a745;
  font-weight: bold;
}

.car_char_input.empty {
  position: relative;
  color: transparent;
}

.car_char_input.empty::after {
  content: "+";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #28a745;
  font-weight: bold;
  font-size: 24px;
  pointer-events: none;
}

.car_keys_combined {
  flex-grow: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  padding: 10px;
  background: #fff;
  user-select: none;
}

.car_key {
  height: 50px;
  font-size: 20px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  color: #333;
  cursor: pointer;
  transition: background-color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 6px;
  box-sizing: border-box;
  text-transform: uppercase;
}

.car_key:hover:not(:disabled) {
  background: #e6f0ff;
  border-color: #007bff;
  color: #007bff;
}

.car_key:active:not(:disabled) {
  background: #cce0ff;
}

.car_key_del {
  background-color: red;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  border: none;
  grid-column: span 3;
  cursor: pointer;
  user-select: none;
  transition: none;
}

.car_key_del:hover,
.car_key_del:active {
  background-color: red !important;
  color: #fff !important;
  box-shadow: none !important;
}

.car_key[disabled] {
  visibility: hidden;
  pointer-events: none;
}

.car_selector_panel {
  position: absolute;
  height: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #ddd;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  padding: 10px 12px;
  gap: 10px;
  box-sizing: border-box;
  z-index: 1000;
}

.car_selector_panel button {
  flex: 0 0 10%;
  min-width: 40px;
  height: 44px;
  margin: 4px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  font-size: 18px;
  line-height: 44px;
  cursor: pointer;
  user-select: none;
  text-align: center;
  box-sizing: border-box;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.car_selector_panel button:hover {
  background: #e6f0ff;
  border-color: #007bff;
  color: #007bff;
}

.car_selector_panel button.active {
  background: #007bff;
  border-color: #0056b3;
  color: #fff;
}

.car_actions {
  flex-shrink: 0;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #ddd;
  background: #fafafa;
  gap: 12px;
  box-sizing: border-box;
  z-index: 1001;
}

.car_btn_cancel,
.car_btn_ok {
  flex-grow: 1;
  font-size: 20px;
  padding: 12px 0;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.car_btn_cancel {
  background: #f0f0f0;
  color: #333;
}

.car_btn_cancel:hover {
  background: #e0e0e0;
}

.car_btn_ok {
  background: #007bff;
  color: #fff;
}

.car_btn_ok:hover {
  background: #0056b3;
}

@media (max-width: 768px) {
  .car_keyboard {
    height: 420px;
    font-size: 16px;
  }
  .car_tab_bar {
    font-size: 14px;
  }
  .car_display {
    height: 60px;
  }
  .car_char_input {
    width: 36px;
    height: 40px;
    font-size: 18px;
  }
  .car_key {
    height: 44px;
    font-size: 16px;
  }
  .car_actions {
    height: 56px;
    padding: 8px 8px;
  }
  .car_btn_cancel,
  .car_btn_ok {
    font-size: 16px;
    padding: 8px 0;
  }
  .car_selector_panel button {
    min-width: 26px;
    height: 36px;
    font-size: 13px;
  }
}
