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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  padding: 2rem 1rem;
}

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

header {
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 0.9rem;
  color: #666;
}

/* Tabs */
.tab-container {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #ddd;
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.6rem 1.2rem;
  border: none;
  background: none;
  font-size: 0.95rem;
  cursor: pointer;
  color: #666;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
  color: #333;
}

.tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

/* Panels */
.panel {
  display: none;
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.panel.active {
  display: block;
}

/* Form elements */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #555;
}

textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: "Consolas", "Monaco", "Noto Sans JP", monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea[readonly] {
  background: #fafafa;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

.btn-primary {
  background-color: #2563eb;
  color: #fff;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-secondary {
  background-color: #e5e7eb;
  color: #374151;
}

.btn-secondary:hover {
  background-color: #d1d5db;
}

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

.btn-row {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

/* Sections within panels */
.field-group {
  margin-bottom: 1.2rem;
}

/* File input */
input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: 2px dashed #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

input[type="file"]:hover {
  border-color: #2563eb;
}

.hint {
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.4rem;
}

/* Status messages */
.status {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  display: none;
}

.status.show {
  display: block;
}

.status.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.status.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.status.processing {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Footer */
footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: #999;
}

footer p {
  margin-bottom: 0.3rem;
}

footer a {
  color: #2563eb;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
  body {
    padding: 1rem 0.5rem;
  }

  header h1 {
    font-size: 1.25rem;
  }

  .tab {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }

  .panel {
    padding: 1rem;
  }
}
