:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #1f2430;
  --text-muted: #6b7280;
  --border: #d7dae2;
  --border-dashed: #b7bcf2;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --success: #0f8a4c;
  --success-bg: #e8f8ef;
  --warn: #b45309;
  --warn-bg: #fff6e5;
  --err: #c62828;
  --err-bg: #fdecec;
  --shadow: 0 2px 10px rgba(20, 20, 40, 0.06);
}

[data-theme="dark"] {
  --bg: #14161f;
  --surface: #1c1f2b;
  --text: #eceef5;
  --text-muted: #9aa0b4;
  --border: #333850;
  --border-dashed: #5a5fb8;
  --accent: #7c7ff2;
  --accent-hover: #9294f5;
  --accent-soft: #262a44;
  --success: #35c47c;
  --success-bg: #0f2a1d;
  --warn: #f2b84b;
  --warn-bg: #332608;
  --err: #f36b6b;
  --err-bg: #341414;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: background 0.25s ease, color 0.25s ease;
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 24px 40px;
}

h1 {
  text-align: center;
  font-size: 28px;
  margin-bottom: 6px;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 32px;
  font-size: 14px;
}

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

.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 10px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  padding: 0 4px;
}

.file-info {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 8px 14px;
}

#fileSize { color: var(--text-muted); }

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 16px;
  max-width: 600px;
  margin: 28px auto 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
}

.field input,
.field select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  width: 100%;
  min-width: 0;
}

@media (max-width: 480px) {
  .controls {
    grid-template-columns: 0.65fr 0.55fr 1.3fr;
    gap: 8px;
  }

  .field {
    font-size: 12px;
  }

  .field input,
  .field select {
    padding: 12px 6px;
    font-size: 15px;
    text-overflow: ellipsis;
  }

  .field select {
    padding-right: 2px;
  }
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.actions {
  text-align: center;
  margin-top: 28px;
}

.progress {
  margin-top: 26px;
  text-align: center;
}

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

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

#progressText {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.result {
  margin-top: 26px;
}

.result-card {
  background: var(--success-bg);
  border: 1px solid var(--success);
  border-radius: 10px;
  padding: 18px 20px;
  text-align: center;
}

.result-card.warn {
  background: var(--warn-bg);
  border-color: var(--warn);
}

.result-card.err {
  background: var(--err-bg);
  border-color: var(--err);
}

.result-title {
  font-weight: 700;
  margin: 0 0 6px;
}

.result-card p#resultDetails,
.result-card p#resultWarnDetails,
.result-card p#resultErrDetails {
  color: var(--text-muted);
  margin: 0 0 14px;
  font-size: 14px;
}

.info-section {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.info-section h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

.info-section h3 {
  font-size: 15px;
  margin: 18px 0 6px;
}

.info-section p,
.info-section li {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.info-section ol,
.info-section ul {
  padding-left: 22px;
  margin: 0;
}

.feature-list li {
  margin-bottom: 8px;
}

.feature-list strong,
.info-section li strong {
  color: var(--text);
}

.faq p {
  margin: 0 0 4px;
}

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