:root {
  --primary-color: #0056b3;
  --accent-color: #007bff;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-main: #333333;
  --text-muted: #666666;
  --border-color: #dee2e6;
  --success-color: #28a745;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  padding: 40px 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

.converter-card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.header {
  text-align: center;
  padding: 40px 20px 20px;
}

.header h1 {
  color: var(--primary-color);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.content-body {
  padding: 30px 50px;
}

.instr-box {
  background-color: #e9f2ff;
  border-left: 4px solid var(--accent-color);
  padding: 15px 20px;
  margin-bottom: 30px;
  border-radius: 4px;
}

.instr-box p {
  font-size: 0.95rem;
  color: #004085;
}

.upload-section {
  background: #ffffff;
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 50px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-section:hover {
  border-color: var(--accent-color);
  background-color: #f0f7ff;
}

.upload-section i {
  font-size: 3rem;
  color: var(--border-color);
  margin-bottom: 10px;
  display: block;
}

.file-info-display {
  display: none;
  margin-top: 20px;
  padding: 15px;
  background-color: #f1f3f5;
  border-radius: 5px;
  font-size: 0.9rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 25px 0;
}

.setting-item {
  display: flex;
  flex-direction: column;
}

.setting-item label {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

select, input[type="text"] {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  outline: none;
}

select:focus {
  border-color: var(--accent-color);
}

.btn-start {
  display: block;
  width: 100%;
  padding: 15px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 10px;
}

.btn-start:hover {
  background-color: #0069d9;
}

.btn-start:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

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

#status-msg {
  margin-top: 15px;
  text-align: center;
  font-weight: 600;
}

/* Modal Style */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 12px;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
}

.step-container {
  padding: 30px;
}

.step-item {
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 30px;
}

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

.step-item h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.img-container {
  position: relative;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f8f9fa;
  width: 100%;
  overflow: hidden;
  margin-bottom: 10px;
}

.img-container img {
  width: 100%;
  height: auto;
  display: block;
}

.highlight-box {
  position: absolute;
  border: 3px solid #ff0000;
  background: rgba(255, 0, 0, 0.1);
  pointer-events: none;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.btn-secondary-tool {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 16px;
  color: var(--accent-color);
  background: white;
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-secondary-tool:hover {
  background-color: #f0f7ff;
  border-color: #0056b3;
  color: #0056b3;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}
