* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #fff;
  color: #333;
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-section,
.switch-area {
  padding: 16px;
  background: #f5f5f5;
  border-radius: 8px;
}

.label {
  display: block;
  font-size: 14px;
  color: #999;
  margin-bottom: 8px;
}

.result {
  font-size: 18px;
  color: #333;
  word-break: break-all;
  min-height: 24px;
}

.switch-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch-area .label {
  margin-bottom: 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}

.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: 0.2s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2979ff;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.btn-area {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button {
  border: none;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 16px;
  cursor: pointer;
  flex: 1;
  min-width: 100px;
}

.btn-primary {
  background: #2979ff;
  color: #fff;
}

.btn-default {
  background: #f0f0f0;
  color: #333;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.reader {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  min-height: 200px;
  display: none;
}

.reader.active {
  display: block;
}

.reader video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-section {
  margin-top: 8px;
}

.results-list {
  list-style: none;
}

.history-item {
  padding: 12px 16px;
  background: #fafafa;
  border-bottom: 1px solid #eee;
  font-size: 15px;
  word-break: break-all;
}

.version {
  text-align: center;
  font-size: 12px;
  color: #999;
  padding: 8px 0;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  pointer-events: none;
  z-index: 1000;
}
