* {
  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;
}

.settings-section,
.parts-section,
.manual-section,
.batch-section {
  padding: 16px;
  background: #f5f5f5;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-section .label,
.batch-section .label {
  margin-bottom: 4px;
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-row label {
  font-size: 14px;
  color: #666;
  display: flex;
  justify-content: space-between;
}

.settings-row input[type="range"] {
  width: 100%;
}

.batch-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #fff;
  border: 2px dashed #ddd;
  border-radius: 8px;
  cursor: pointer;
  color: #666;
  font-size: 14px;
  transition: border-color 0.2s;
}

.file-label:hover {
  border-color: #2979ff;
}

.file-label input {
  display: none;
}

.batch-info {
  font-size: 14px;
  color: #666;
  min-height: 20px;
}

.batch-progress {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.batch-bar {
  height: 100%;
  background: #2979ff;
  transition: width 0.3s ease;
}

.batch-results {
  margin-top: 4px;
}

.parts-info {
  font-size: 16px;
  color: #333;
  word-break: break-all;
  min-height: 22px;
}

.parts-progress {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.parts-bar {
  height: 100%;
  background: #2979ff;
  transition: width 0.3s ease;
}

.manual-section textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
  resize: vertical;
  font-family: inherit;
}

.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;
}
