* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
  font-size: 14px;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.page-wrapper {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
  max-width: 1280px;
}

.ad-slot {
  width: 300px;
  min-width: 300px;
  height: 600px;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 13px;
  position: sticky;
  top: 32px;
  margin-top: 45px;
}

/* 화면이 좁으면 광고 숨김 */
@media (max-width: 1000px) {
  .ad-slot.ad-left { display: none; }
}
@media (max-width: 1280px) {
  .ad-slot.ad-right { display: none; }
}

.container {
  width: 100%;
  max-width: 640px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
}
h1 span { color: #0078d4; }

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
}
.card-title {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* Drop zone */
#dropzone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 20px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
#dropzone:hover, #dropzone.dragover {
  border-color: #0078d4;
  background: #f0f6ff;
}
#dropzone .icon { font-size: 36px; margin-bottom: 8px; }
#dropzone p { color: #666; line-height: 1.6; }
#dropzone p strong { color: #0078d4; }
#dropzone small { color: #999; font-size: 12px; }
#file-input { display: none; }

/* File list */
#file-list {
  display: none;
  margin-top: 12px;
  border: 1px solid #eee;
  border-radius: 6px;
  overflow: hidden;
}
.file-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}
.file-item:last-child { border-bottom: none; }
.file-item:nth-child(even) { background: #fafafa; }
.file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: #888; font-size: 12px; margin-left: 8px; flex-shrink: 0; }
.file-remove {
  background: none; border: none; cursor: pointer;
  color: #bbb; font-size: 16px; margin-left: 8px;
  padding: 0 4px; line-height: 1;
}
.file-remove:hover { color: #e00; }

/* Quality */
.quality-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.quality-row label { white-space: nowrap; }
.quality-row input[type=range] { flex: 1; accent-color: #0078d4; }
.quality-val {
  font-weight: 700;
  color: #0078d4;
  width: 28px;
  text-align: right;
}

/* Buttons */
.btn-row {
  display: flex;
  gap: 8px;
}
button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-primary {
  background: #0078d4;
  color: #fff;
  flex: 1;
}
.btn-primary:hover { background: #005fa3; }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }
.btn-secondary {
  background: #eee;
  color: #444;
}
.btn-secondary:hover { background: #ddd; }

/* Progress */
progress {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  border: none;
  background: #eee;
}
progress::-webkit-progress-bar { background: #eee; border-radius: 3px; }
progress::-webkit-progress-value { background: #0078d4; border-radius: 3px; }

/* Log */
#log {
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 6px;
  padding: 12px;
  font-family: 'Consolas', 'D2Coding', monospace;
  font-size: 12px;
  line-height: 1.7;
  height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.log-ok { color: #6dbe6d; }
.log-err { color: #f47067; }
.log-info { color: #79c0ff; }

/* Download all */
#btn-download-all {
  display: none;
  width: 100%;
  background: #107c10;
  color: #fff;
}
#btn-download-all:hover { background: #0a5c0a; }

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #888;
}
