* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --blue: #1560f5;
  --blue-dark: #0a1a5c;
  --blue-mid: #1245b8;
  --blue-light: #eef3ff;
  --blue-pale: #f5f8ff;
  --bg: #f4f7fe;
  --border: #dde4ff;
  --border-strong: #c0ccee;
  --text: #0d1b4b;
  --text-2: #2a3a6a;
  --muted: #6b7baa;
  --muted-light: #9caad4;
  --green: #1b8c5a;
  --green-bg: #e6f7ef;
  --red: #e53935;
  --orange: #e67e22;
  --orange-bg: #fef3e8;
  --shadow-sm: 0 1px 4px rgba(21, 96, 245, 0.09);
  --radius: 10px;
  --radius-sm: 6px;
}
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

.header {
  background: linear-gradient(135deg, #0a1a5c 0%, #0d2a8a 100%);
  padding: 24px 40px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  top: -200px;
  right: -100px;
  pointer-events: none;
}
.header-logo {
  position: relative;
  z-index: 1;
  height: 32px;
  display: block;
  filter: brightness(0) invert(1);
  margin-bottom: 10px;
}
.header-badge {
  background: rgba(21, 96, 245, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 11px;
  border-radius: 20px;
  position: relative;
  z-index: 1;
}
.header-title {
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  text-align: center;
  position: relative;
  z-index: 1;
  line-height: 1.2;
}
.header-sub {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 520px;
  line-height: 1.5;
}
.header-hook {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
  position: relative;
  z-index: 1;
  font-style: italic;
  margin-top: 2px;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.progress-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 26px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 12px 18px;
}
.progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 6px;
  background: var(--blue);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.progress-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-left: 12px;
  white-space: nowrap;
}

.card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}
.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--blue);
}
.card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.card-desc {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

.question-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.45;
}
.question-hint {
  font-size: 12px;
  color: var(--muted);
  margin: -10px 0 16px;
  line-height: 1.5;
}
.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  background: #fff;
}
.option:hover {
  border-color: var(--blue);
  background: var(--blue-pale);
}
.option.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(21, 96, 245, 0.1);
}
.option-radio {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all 0.15s;
}
.option.selected .option-radio {
  border-color: var(--blue);
  background: var(--blue);
}
.option-radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  display: none;
}
.option.selected .option-radio-dot {
  display: block;
}
.option-content {
  flex: 1;
}
.option-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.option-desc {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(21, 96, 245, 0.3);
}
.btn-primary:hover {
  background: var(--blue-mid);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: none;
}
.btn-ghost:hover {
  color: var(--text);
}
.btn-green {
  background: var(--green);
  color: #fff;
}
.btn-green:hover {
  background: #157a4c;
}
.btn-lg {
  padding: 13px 28px;
  font-size: 14.5px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}
.btn-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.result-hero {
  text-align: center;
  margin-bottom: 24px;
}
.result-level {
  font-size: 64px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}
.result-level-max {
  font-size: 24px;
  color: var(--muted);
  font-weight: 600;
}
.result-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-top: 8px;
}
.result-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.gauge-wrap {
  display: flex;
  justify-content: center;
  margin: 20px 0 28px;
}
.gauge-levels {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
.gauge-bar {
  width: 48px;
  border-radius: 4px 4px 0 0;
  transition: all 0.5s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6px;
}
.gauge-bar-num {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  opacity: 0.9;
}
.gauge-bar-label {
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  margin-top: 6px;
  line-height: 1.2;
  color: var(--muted);
}

.radar-wrap {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.dim-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
}
.dim-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.dim-card-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.dim-card-score {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
}
.dim-card-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.dim-card-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.ai-sel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 12.5px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
  white-space: nowrap;
}
.ai-sel-btn:hover {
  border-color: var(--blue);
  background: var(--blue-pale);
}
.ai-sel-btn.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(21, 96, 245, 0.1);
}

.pstep {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.pstep-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pstep-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}
.pstep-text strong {
  color: var(--text);
}

#prompt-box {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-family: "Inter", monospace;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 460px;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.result-doc {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
  min-height: 400px;
  outline: none;
  line-height: 1.7;
  font-size: 14px;
  color: var(--text);
}
.result-doc h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue-dark);
  margin-bottom: 6px;
  line-height: 1.25;
}
.result-doc h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-top: 28px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--border);
}
.result-doc h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-top: 18px;
  margin-bottom: 7px;
}
.result-doc p {
  margin-bottom: 10px;
  line-height: 1.65;
}
.result-doc ul,
.result-doc ol {
  margin: 8px 0 12px 20px;
}
.result-doc li {
  margin-bottom: 5px;
  line-height: 1.6;
}
.result-doc strong {
  color: var(--text);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: none;
  margin-bottom: 0;
}
.tb-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--muted);
  font-family: "Inter", sans-serif;
  transition: all 0.15s;
}
.tb-btn:hover {
  background: var(--blue-light);
  color: var(--blue);
}
.tb-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 3px;
}

.dl-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  background: #1e2d5a;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 14px;
}
.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: all 0.15s;
}
.btn-dl:hover {
  background: rgba(255, 255, 255, 0.2);
}

.cta-box {
  background: linear-gradient(135deg, #0a1a5c 0%, #0d2a8a 100%);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-top: 20px;
}
.cta-box h3 {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 3px;
}
.cta-box p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}
.btn-white {
  background: #fff;
  color: #0a1a5c;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-white:hover {
  background: var(--blue-light);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: #0a1a5c;
  color: #fff;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 2000;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.section {
  display: none;
}
.section.active {
  display: block;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.field-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field-label span {
  color: var(--red);
}
input[type="text"],
textarea,
select {
  font-size: 13px;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  width: 100%;
  font-family: "Inter", sans-serif;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 96, 245, 0.1);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted-light);
}
textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7BAA' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
  padding-right: 30px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.cta-items {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
@media (max-width: 540px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .header {
    padding: 20px 18px 24px;
  }
  .container {
    padding: 20px 14px 60px;
  }
  .card {
    padding: 16px 15px 14px;
  }
  .gauge-bar {
    width: 36px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .result-doc {
    padding: 20px 15px;
  }
  .cta-items {
    flex-direction: column;
    gap: 15px;
    align-items: start !important;
  }
}
@media print {
  .header,
  .progress-bar,
  .btn-actions,
  .toast,
  .cta-box,
  .dl-bar,
  .editor-toolbar,
  #section-profile,
  #section-quiz,
  #section-prompt,
  [onclick="resetAll()"] {
    display: none !important;
  }
  .result-doc {
    border: none;
    padding: 20px 0;
    box-shadow: none;
  }
  body {
    background: #fff;
  }
  h2,
  h3 {
    page-break-after: avoid;
  }
  p {
    orphans: 3;
    widows: 3;
  }
}
