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

body {
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: #f5f5f7;
  color: #1a1a2e;
  min-height: 100vh;
}

.accent-bar {
  height: 4px;
  background: linear-gradient(90deg, #7F77DD, #1D9E75, #D85A30, #D4537E);
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
  padding-top: 36px;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-title .icon {
  font-size: 24px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  margin-bottom: 6px;
  margin-top: 16px;
}

label:first-of-type {
  margin-top: 0;
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fafafa;
  transition: border-color 0.2s;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7F77DD;
  background: #fff;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.btn-main {
  display: block;
  width: 100%;
  padding: 14px;
  background: #7F77DD;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: opacity 0.2s;
  font-family: inherit;
}

.btn-main:hover {
  opacity: 0.85;
}

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

.btn-sub {
  display: block;
  width: 100%;
  padding: 12px;
  background: #f0f0f5;
  color: #555;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
  transition: opacity 0.2s;
  font-family: inherit;
}

.btn-sub:hover {
  opacity: 0.8;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin: 4px 4px 4px 0;
  cursor: pointer;
}

.tag-purple { background: #EEEDFE; color: #3C3489; }
.tag-teal   { background: #E1F5EE; color: #0F6E56; }
.tag-coral  { background: #FAECE7; color: #993C1D; }
.tag-pink   { background: #FBEAF0; color: #72243E; }

.tag-add {
  border: 1.5px dashed #D4537E;
  color: #D4537E;
  background: transparent;
  padding: 3px 11px;
}

.error-msg {
  color: #D85A30;
  font-size: 13px;
  margin-top: 8px;
}

.success-msg {
  color: #1D9E75;
  font-size: 13px;
  margin-top: 8px;
}

.score-box {
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.score-first { background: #FAECE7; color: #993C1D; }
.score-final { background: #E1F5EE; color: #0F6E56; }

.result-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.result-row:last-child {
  border-bottom: none;
}

.dot-ok  { width: 10px; height: 10px; border-radius: 50%; background: #1D9E75; flex-shrink: 0; margin-top: 4px; }
.dot-ng  { width: 10px; height: 10px; border-radius: 50%; background: #D85A30; flex-shrink: 0; margin-top: 4px; }

.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: #f0f0f0;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: #7F77DD;
  transition: width 0.3s;
}

.question-card {
  background: #EEEDFE;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  font-size: 15px;
  color: #3C3489;
  line-height: 1.7;
}

.feedback-box {
  background: #FAECE7;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #993C1D;
  margin-bottom: 8px;
  line-height: 1.6;
}

.history-item {
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.history-item:hover {
  opacity: 0.7;
}

.loading {
  text-align: center;
  color: #999;
  font-size: 14px;
  padding: 20px;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-top-color: #7F77DD;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7F77DD;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 16px;
}
