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

:root {
  --bg: #0f0a1f;
  --bg2: #1a1130;
  --card: #1f1638;
  --accent: #c9a96e;
  --accent2: #8b5cf6;
  --text: #e8e3f3;
  --muted: #8a82a3;
  --border: #2d2347;
  --success: #4ade80;
  --error: #f87171;
}

body {
  font-family: 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  background: linear-gradient(135deg, var(--bg), var(--bg2));
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  padding: 20px;
}

header {
  text-align: center;
  padding: 40px 20px 30px;
  max-width: 900px;
  margin: 0 auto;
}

header h1 {
  font-size: 2.2rem;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card h2 {
  color: var(--accent);
  margin-bottom: 16px;
  font-size: 1.3rem;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.hint a {
  color: var(--accent2);
  text-decoration: underline;
}

.row {
  display: flex;
  gap: 12px;
}

.row input {
  flex: 1;
}

.form-group {
  margin-bottom: 18px;
  flex: 1;
}

.form-row {
  display: flex;
  gap: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}

.opt {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
  margin-left: 6px;
}

.req {
  background: var(--accent);
  color: var(--bg);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 700;
}

.section-title {
  color: var(--accent);
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 1.05rem;
}

.section-title:first-of-type {
  margin-top: 10px;
}

.hint-small {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 6px;
}

.hint-box {
  background: rgba(201, 169, 110, 0.08);
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 8px 0 12px;
  font-size: 0.86rem;
}

.hint-box p {
  margin: 6px 0;
  color: var(--text);
}

.hint-box strong {
  color: var(--accent);
}

.hint-box ul {
  margin: 8px 0 8px 8px;
  padding: 0;
  list-style: none;
}

.hint-box li {
  margin: 4px 0;
  padding-left: 4px;
  color: var(--text);
  font-size: 0.85rem;
}

.hint-small-em {
  color: var(--accent2) !important;
  font-size: 0.8rem !important;
  margin-top: 10px !important;
  font-weight: 600;
}

textarea#question {
  font-size: 0.92rem;
  line-height: 1.7;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 400;
  margin-bottom: 0;
  transition: all 0.15s;
}

.check-item:hover {
  border-color: var(--accent);
}

.check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  margin: 0;
}

.check-item:has(input:checked) {
  background: rgba(201, 169, 110, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

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

input[type="file"] {
  width: 100%;
  padding: 10px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.preview {
  display: block;
  margin-top: 10px;
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

button {
  padding: 12px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  font-family: inherit;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  margin-top: 10px;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.secondary-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

#save-key {
  background: var(--accent);
  color: var(--bg);
}

.status {
  margin-top: 10px;
  font-size: 0.85rem;
  min-height: 20px;
}

.status.ok { color: var(--success); }
.status.err { color: var(--error); }

.hidden { display: none !important; }

#progress-list {
  list-style: none;
  margin: 16px 0;
}

#progress-list li {
  padding: 8px 0;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

#progress-list li.done { color: var(--success); }
#progress-list li.active { color: var(--accent); }

.progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 12px;
}

#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%;
  transition: width 0.4s;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.result-actions {
  display: flex;
  gap: 10px;
}

.result-actions button {
  width: auto;
  padding: 10px 18px;
  margin: 0;
  font-size: 0.9rem;
}

#report-content {
  line-height: 2.0;
  font-size: 0.95rem;
}

#report-content strong {
  color: var(--accent);
  font-weight: 700;
  background: rgba(201, 169, 110, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
}

#report-content p {
  margin-bottom: 18px;
}

#report-content h1 {
  font-size: 1.8rem;
  margin: 30px 0 16px;
  color: var(--accent);
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
}

#report-content h2 {
  font-size: 1.4rem;
  margin: 26px 0 14px;
  color: var(--accent2);
}

#report-content h3 {
  font-size: 1.15rem;
  margin: 20px 0 10px;
  color: var(--accent);
}

#report-content p {
  margin-bottom: 14px;
}

#report-content ul, #report-content ol {
  margin: 10px 0 16px 24px;
}

#report-content li {
  margin-bottom: 6px;
}

#report-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
}

#report-content th, #report-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

#report-content th {
  background: var(--bg);
  color: var(--accent);
}

#report-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin: 14px 0;
  color: var(--muted);
  font-style: italic;
}

#report-content code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Menlo', monospace;
  font-size: 0.9em;
}

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

@media (max-width: 600px) {
  .form-row { flex-direction: column; gap: 0; }
  header h1 { font-size: 1.6rem; }
  .card { padding: 20px; }
}
