:root {
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-border: #d7dbe0;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-text: #1f2430;
  --color-muted: #6b7280;
  --color-warn-bg: #fff7ed;
  --color-warn-border: #fdba74;
  --color-warn-text: #9a3412;
  --color-success: #16a34a;
  --color-error: #dc2626;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

header {
  padding: 32px 20px 8px;
  text-align: center;
}

header h1 {
  margin: 0 0 6px;
  font-size: 1.6rem;
}

.subtitle {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

main {
  max-width: 720px;
  margin: 24px auto;
  padding: 0 20px 40px;
}

.drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 40px 20px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone.dragover {
  border-color: var(--color-primary);
  background: #eef2ff;
}

.drop-zone .or {
  color: var(--color-muted);
  margin: 10px 0;
  font-size: 0.9rem;
}

.file-picker {
  display: inline-block;
  padding: 10px 22px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}

.file-picker:hover {
  background: var(--color-primary-dark);
}


.file-list {
  margin-top: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.file-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
}

.convert-button {
  padding: 8px 20px;
  border: none;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.convert-button:disabled {
  background: #b9c2d0;
  cursor: not-allowed;
}

.convert-button:not(:disabled):hover {
  background: var(--color-primary-dark);
}

#file-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}

.file-item:last-child {
  border-bottom: none;
}

.file-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.file-name {
  font-weight: 600;
  word-break: break-all;
}

.file-size {
  color: var(--color-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.file-warning {
  color: var(--color-warn-text);
  font-size: 0.8rem;
  margin-top: 4px;
}

.file-status {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.file-status.status-success {
  color: var(--color-success);
}

.file-status.status-error {
  color: var(--color-error);
}

.progress-bar {
  margin-top: 8px;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  transition: width 0.2s ease;
}

.download-link {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 16px;
  background: var(--color-success);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.log-section {
  margin-top: 20px;
}

.log-section pre {
  max-height: 200px;
  overflow-y: auto;
  background: #111827;
  color: #d1d5db;
  padding: 12px;
  border-radius: var(--radius);
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
}

footer {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.78rem;
  padding: 20px;
}

.version-info {
  margin-top: 8px;
  font-size: 0.72rem;
  opacity: 0.8;
}
