:root {
  --primary: #1a1a2e;
  --accent: #e94560;
  --accent-light: #ff6b81;
  --bg: #f8f9fa;
  --card: #ffffff;
  --text: #2d3436;
  --text-light: #636e72;
  --border: #dfe6e9;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #d63031;
  --radius: 12px;
}

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

body {
  font-family: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--primary);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header h1 { font-size: 1.2rem; font-weight: 600; }
.header .badge {
  background: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Container */
.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Card */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.card h2 {
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card h2::before {
  content: '';
  width: 4px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 2px;
}

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group { margin-bottom: 1rem; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text-light);
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Drop zone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafbfc;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: #fff5f7;
}
.dropzone .icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.dropzone .label { font-weight: 600; color: var(--text); }
.dropzone .hint { font-size: 0.8rem; color: var(--text-light); margin-top: 0.3rem; }
.dropzone .file-name {
  margin-top: 0.5rem;
  font-weight: 700;
  color: var(--accent);
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover { background: var(--accent); color: white; }
.btn-full { width: 100%; justify-content: center; }

/* Progress */
.progress-steps {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
}
.progress-step {
  flex: 1;
  text-align: center;
  position: relative;
}
.progress-step::after {
  content: '';
  position: absolute;
  top: 1.2rem;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
}
.progress-step:last-child::after { display: none; }
.progress-step.active::after { background: var(--accent); }
.progress-step .dot {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--border);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}
.progress-step.active .dot { background: var(--accent); }
.progress-step.done .dot { background: var(--success); }
.progress-step .text { font-size: 0.8rem; color: var(--text-light); }
.progress-step.active .text { color: var(--accent); font-weight: 600; }

/* Result */
.ua-display {
  text-align: center;
  padding: 2rem;
}
.ua-value {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
}
.ua-value.pass { color: var(--success); }
.ua-value.fail { color: var(--danger); }
.ua-unit { font-size: 1rem; color: var(--text-light); font-weight: 400; }
.ua-judgment {
  display: inline-block;
  padding: 0.3rem 1.2rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 0.8rem;
}
.ua-judgment.pass { background: #d4edda; color: #155724; }
.ua-judgment.fail { background: #f8d7da; color: #721c24; }
.ua-standard {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  background: var(--primary);
  color: white;
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 600;
}
.data-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.data-table tr:hover { background: #f1f3f5; }
.data-table .pass { color: var(--success); font-weight: 700; }
.data-table .fail { color: var(--danger); font-weight: 700; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Actions row */
.actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Spinner */
.spinner {
  width: 3rem;
  height: 3rem;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Hidden */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .ua-value { font-size: 3rem; }
  .actions { flex-direction: column; }
}
