:root {
  --bg: #121212;
  --bg-elevated: #1e1e1e;
  --border: #2e2e2e;
  --text: #e8e8e8;
  --text-muted: #9a9a9a;
  --accent: #ff3b30;
  --accent-hover: #ff5147;
  --success: #2ecc71;
  --danger: #e74c3c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

.container {
  width: 100%;
  max-width: 640px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

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

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

.field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 12px;
  font-size: 0.95rem;
  resize: vertical;
  font-family: inherit;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0;
  gap: 24px;
}

.option-group {
  flex: 1;
}

.toggle-buttons {
  display: flex;
  gap: 8px;
}

.type-btn {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.15s, color 0.15s;
}

.type-btn.active {
  border-color: var(--accent);
  color: var(--text);
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 26px;
  transition: background 0.15s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.15s, background 0.15s;
}

.switch input:checked + .slider {
  background: rgba(255, 59, 48, 0.25);
  border-color: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
  background: var(--accent);
}

.convert-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.convert-btn:hover {
  background: var(--accent-hover);
}

.convert-btn:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: not-allowed;
}

.progress-section {
  margin-top: 24px;
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: var(--bg-elevated);
  border-radius: 6px;
  overflow: hidden;
}

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

.progress-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 8px;
}

.result-section {
  margin-top: 28px;
}

.result-section h2 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-list a {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--success);
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  word-break: break-all;
}

.file-list a:hover {
  border-color: var(--success);
}

.error-message {
  margin-top: 20px;
  color: var(--danger);
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.9rem;
}

.hidden {
  display: none;
}
