* { box-sizing: border-box; outline: none; }
body {
  margin: 4px 4px 98px 4px;
  padding: 0;
  font-size: 12pt;
  font-family: Arial, Helvetica, sans-serif;
  background: #fff;
  transition: margin-right 0.3s ease;
}
body.menu-open {
  margin-right: 280px;
}
.title {
  margin: 0.2em 0 0 0;
  font-weight: bold;
  text-shadow: 0 -1px rgba(0,0,0,.6);
  font-size: 14pt;
  line-height: 32px;
  background: #115f97;
  padding: 5px 15px 5px 36px;
  color: #fff;
  border-radius: 10px 10px 0 0;
  box-shadow: inset 0 0 5px rgba(53,86,129,.5);
}
.memo {
  font-size: 12pt;
  font-weight: bold;
  border: solid 1px silver;
  background-color: #eee;
  padding: 10px;
  word-wrap: break-word;
  white-space: pre-line;
  overflow: hidden;
  min-height: 40px;
  margin-bottom: 10px;
  border-radius: 0 0 10px 10px;
}
.selected { background-color: yellow; font-weight: bold; }
.gs { color: red; font-weight: bold; }
.rs { color: green; font-weight: bold; }
.eot { color: blue; font-weight: bold; }
.gray { color: silver; font-weight: bold; }
table { width: 100%; border-collapse: collapse; }
table, th, td { border: solid 1px silver; }
th { background-color: #eee; padding: 8px; }
td { word-break: break-all; white-space: pre-line; }
.ct { text-align: center; }
.bottomArea {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 0;
  text-align: center;
  background: #d9edf5;
  border-top: solid 4px #24A7D3;
  z-index: 20;
}
.tabButtonArea {
  position: fixed;
  bottom: 86px;
  left: 0;
  right: 0;
  padding: 6px 4px;
  overflow-x: auto;
  white-space: nowrap;
  background-color: #ccc;
  z-index: 19;
}
button {
  box-shadow: inset 0 1px 0 0 #54a3f7;
  background: linear-gradient(to bottom, #007dc1 5%, #0061a7 100%);
  background-color: #007dc1;
  border-radius: 6px;
  border: 1px solid #124d77;
  color: #fff;
  cursor: pointer;
  font-size: 14pt;
  font-weight: bold;
  text-shadow: 0 1px 0 #154682;
}
button:active { transform: scale(.95); }
.bottomArea button { width: 32%; height: 60px; }
.tabButtonArea button { width: 80px; height: 50px; }
.tabButtonArea button.selected {
  box-shadow: inset 0 1px 0 0 #f9eca0;
  background: linear-gradient(to bottom, #f0c911 5%, #f2ab1e 100%);
  background-color: #f0c911;
  border: 1px solid #e65f44;
  color: #c92200;
  text-shadow: 0 1px 0 #ded17c;
}
.dim-layer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
}
.dimBg {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #000;
  opacity: .5;
}
.pop-layer {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(420px, 92vw);
  transform: translate(-50%, -50%);
  background-color: #fff;
  border: 5px solid #3571B5;
  z-index: 110;
  max-height: 90vh;
  overflow: auto;
}
.pop-container { padding: 20px 25px; }
.pop-btns { display: flex; gap: 8px; margin-top: 10px; }
.pop-btns button { flex: 1; height: 52px; }
#txtBarcodeData { width: 100%; min-height: 160px; font-size: 12pt; }
#historyListArea {
  margin-top: 8px;
  border: solid 1px silver;
  background-color: #eee;
  padding: 10px;
  max-height: 40vh;
  overflow: auto;
  white-space: pre-wrap;
  font-family: Consolas, monospace;
  font-size: 10pt;
}
.history-item {
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #999;
  background: #fff;
  color: #222;
  text-shadow: none;
  box-shadow: none;
  font-family: Consolas, monospace;
  font-size: 10pt;
  line-height: 1.35;
}
.history-item:last-child { margin-bottom: 0; }
.history-item-title {
  display: block;
  margin-bottom: 4px;
  font-weight: bold;
}
.history-item-data {
  display: block;
  word-break: break-all;
}
.history-item:hover { background: #f3f9ff; border-color: #3571B5; }
.history-item:active { transform: none; background: #e8f3ff; }
#cameraModal video { width: 100%; border: 1px solid #999; background: #000; }
.hidden { display: none; }
.video-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid #999;
  background: #000;
  margin-bottom: 10px;
}
.video-wrapper video {
  display: block;
  width: 100%;
}
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to bottom, transparent, #00ff00 50%, transparent);
  box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
  animation: scanMove 2s linear infinite;
  pointer-events: none;
  z-index: 10;
}
@keyframes scanMove {
  0% {
    top: 0%;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}
.scan-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  background: #f0f8ff;
  border: 1px solid #3571B5;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 12pt;
  font-weight: bold;
  color: #1f3f62;
}
.status-icon {
  font-size: 16pt;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}
.top-controls {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 30;
  display: flex;
  gap: 8px;
  align-items: center;
}
.menu-toggle {
  font-size: 16pt;
  padding: 6px 10px;
  height: 36px;
  min-width: 44px;
  background: linear-gradient(to bottom, #115f97 5%, #0d4a75 100%);
  background-color: #115f97;
  border: 1px solid #0a3d5f;
  color: #fff;
  text-shadow: 0 1px 0 #0a3d5f;
}
.lang-switch {
  display: none;
}
.lang-switch button {
  font-size: 10pt;
  padding: 6px 10px;
  height: 36px;
  min-width: 78px;
}
.mode-switch {
  display: none;
}
.mode-switch button {
  font-size: 10pt;
  padding: 6px 10px;
  height: 34px;
  min-width: 78px;
}
.mode-switch button.selected {
  box-shadow: inset 0 1px 0 0 #f9eca0;
  background: linear-gradient(to bottom, #f0c911 5%, #f2ab1e 100%);
  background-color: #f0c911;
  border: 1px solid #e65f44;
  color: #c92200;
  text-shadow: 0 1px 0 #ded17c;
}
.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0,0,0,0.3);
  z-index: 1001;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.side-menu.open {
  transform: translateX(0);
}
.side-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #115f97;
  color: #fff;
  font-size: 14pt;
  font-weight: bold;
}
.menu-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18pt;
  padding: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  box-shadow: none;
  text-shadow: none;
}
.menu-close:active {
  transform: scale(1);
  background: rgba(255,255,255,0.2);
}
.side-menu-section {
  padding: 20px;
  border-bottom: 1px solid #eee;
}
.side-menu-label {
  font-size: 11pt;
  font-weight: bold;
  color: #1f3f62;
  margin-bottom: 10px;
}
.side-menu-buttons {
  display: flex;
  gap: 8px;
}
.side-menu-buttons button {
  flex: 1;
  font-size: 10pt;
  padding: 8px 12px;
  height: 42px;
}
.side-menu-buttons button.selected {
  box-shadow: inset 0 1px 0 0 #f9eca0;
  background: linear-gradient(to bottom, #f0c911 5%, #f2ab1e 100%);
  background-color: #f0c911;
  border: 1px solid #e65f44;
  color: #c92200;
  text-shadow: 0 1px 0 #ded17c;
}
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}
.menu-overlay.open {
  display: block;
}

#entryGateModal {
  z-index: 1000;
}
#entryGateModal .pop-layer {
  z-index: 1010;
}
.gate-tip {
  margin-top: 10px;
}
.gate-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gate-form label {
  font-weight: bold;
  color: #1f3f62;
}
.gate-form input {
  width: 100%;
  height: 42px;
  padding: 8px 10px;
  font-size: 12pt;
  border: 1px solid #7a98b8;
  border-radius: 6px;
}
