* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background-color: #f3f4f6;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  padding: 20px 12px;
}
.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto; 
}
.container > h1 {
  font-size: 20px;
  margin-bottom: 16px;
  color: #1f2937;
}
.main-flex {
  display: flex;
  gap: 16px;
  align-items: stretch;
} 
.panel {
  background: #ffffff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.left-control {flex: 0 0 440px;}
.preview-right {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.preview-right h2 {
  margin: 0 0 12px 0;
  flex-shrink: 0;
  font-size: 17px;
  color: #1f2937;
}
.preview-box {
  width: 100%; 
  height: 380px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  overflow: auto;
  background: #fcfcfc;
}
.ctrl-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.upload-encode-row {
  gap: 14px;
  align-items: stretch;
  margin-bottom: 8px;
}
.upload-area {color:#444;
  flex: 1;
  border: 2px solid #ccc;
  border-radius: 6px;
  padding: 3px;
  text-align: center;
  font-size: 14px;
  position: relative;
}
.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
} 
label {
  font-size: 12px;
  margin-right: 6px;
  color: #374151;
}
select,
input[type="text"] {
  padding: 4px 7px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
}
.btn {
  padding: 5px 12px;
  font-size: 13px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.btn-primary {
  background-color: #2563eb;
  color: #fff;
}
.btn-danger {
  background-color: #dc2626;
  color: #fff;
}
.btn-success {
  background-color: #16a34a;
  color: #fff;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.file-list {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  height: 180px;
  overflow-y: auto;
  font-size: 13px;
}
.file-list button[data-idx] {width:20px;margin-bottom:3px;
  height:20px;
  font-size:14px;
}
.left-control h3 {
  font-size: 14px;
  margin-top:10px;
  margin-bottom:6px;
  color:#1f2937;
}
.left-control > div:nth-of-type(3),
.left-control > div:nth-of-type(4) {
  margin-bottom:8px;
}
@media (max-width: 920px) {
  .main-flex {
    flex-direction: column;
  }
  .left-control {
    flex: none;
  }
  .preview-box {
    height: 360px;
  }
  .file-list {
    height: 180px;
  }
}
