:root {
  --bg: #f7f7f4;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e3e3dd;
  --accent: #1f6feb;
  --accent-soft: rgba(31, 111, 235, 0.18);
  --warn: #c8553d;
  --card-bg: #ffffff;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --maxw: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 64px 20px 48px;
  min-height: 100vh;
}

#result.screen { align-items: flex-start; }


.screen.hidden { display: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
}

/* Intro */

.brand {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: 3px;
  margin: 0 0 4px;
  position: relative;
  display: inline-block;
}

.brand::after {
  content: '';
  display: block;
  width: 56px;
  height: 4px;
  background: var(--accent);
  margin-top: 14px;
  border-radius: 2px;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 1.5px;
  margin: 16px 0 32px;
  text-transform: uppercase;
}

.lead {
  font-size: 18px;
  margin: 0 0 28px;
}

.dims {
  list-style: none;
  padding: 0;
  margin: 0 0 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dims li {
  background: var(--card-bg);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0 0;
}

/* Buttons */

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--fg);
  padding: 10px 20px;
  font-size: 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}

.btn:hover:not(:disabled) { border-color: var(--fg); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.primary {
  background: var(--fg);
  color: #fff;
  border-color: var(--fg);
}

.btn.primary:hover:not(:disabled) {
  background: #000;
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

/* Quiz */

.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.progress-text {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 56px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--fg);
  width: 0%;
  transition: width .25s ease;
}

.question-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 28px 24px;
  margin-bottom: 24px;
}

.question-meta {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.question-prompt {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 20px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  appearance: none;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}

.option:hover { border-color: var(--fg); }

.option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.options.likert {
  flex-direction: row;
  gap: 8px;
}

.options.likert .option {
  flex: 1;
  text-align: center;
  padding: 14px 6px;
  font-size: 13px;
  line-height: 1.3;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Result */

.result-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 28px;
  box-shadow: var(--shadow);
}

.result-card.low-confidence {
  border-color: var(--warn);
}

.low-confidence-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--warn);
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: .5px;
}

.shortcoming {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 400;
  color: var(--warn);
  letter-spacing: 0;
  line-height: 1.5;
}

.validity-notice {
  margin-top: 18px;
  font-size: 12px;
  font-style: italic;
  color: var(--warn);
  line-height: 1.5;
  padding: 8px 12px;
  background: rgba(200, 85, 61, 0.08);
  border-radius: 8px;
}

/* Modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}

.modal h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.modal p {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}

.brand-mini {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--muted);
}

.total-score {
  font-size: 14px;
  color: var(--muted);
}

.total-score span#total-score {
  font-size: 36px;
  font-weight: 700;
  color: var(--fg);
  margin-left: 6px;
}

.score-unit {
  font-size: 13px;
  color: var(--muted);
}

.main-tag {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 4px 0 4px;
}

.main-tag .one-liner {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0;
}

#radar-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0 8px;
}

#radar {
  width: 100%;
  max-width: 380px;
  height: auto;
  overflow: visible;
}

.dim-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
}

.dim-list li {
  position: relative;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--line);
  --score: 0%;
}

.dim-list li::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: var(--score);
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width .4s ease;
}

.dim-list li .dim-name { color: var(--fg); }
.dim-list li .dim-score { color: var(--muted); font-variant-numeric: tabular-nums; }

.d6-sub {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  background: #fafaf6;
  border: 1px dashed var(--line);
  padding: 10px 14px;
  border-radius: 10px;
}

.d6-sub strong { color: var(--fg); font-weight: 600; }

.watermark {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .5px;
}

.result-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Radar SVG */

/* 分层网格：由外向内 alpha 递增；最外层带细描边定义边界 */
.radar-ring-5 {
  fill: rgba(31, 111, 235, 0.045);
  stroke: rgba(31, 111, 235, 0.45);
  stroke-width: 1.2;
}
.radar-ring-4 { fill: rgba(31, 111, 235, 0.065); stroke: none; }
.radar-ring-3 { fill: rgba(31, 111, 235, 0.085); stroke: none; }
.radar-ring-2 { fill: rgba(31, 111, 235, 0.11);  stroke: none; }
.radar-ring-1 { fill: rgba(31, 111, 235, 0.14);  stroke: none; }

.radar-axis {
  stroke: rgba(0, 0, 0, 0.08);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.radar-label {
  font-size: 12px;
  fill: var(--fg);
  font-weight: 600;
  letter-spacing: .5px;
}

.radar-tick {
  font-size: 9px;
  fill: var(--muted);
  opacity: .55;
}

.radar-poly {
  fill: rgba(31, 111, 235, 0.30);
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 6px rgba(31, 111, 235, 0.18));
}

.radar-point {
  fill: #ffffff;
  stroke: var(--accent);
  stroke-width: 2;
}

/* ===== Portrait share card (1080×1350) ===== */

body.share-preview #app { display: none !important; }
body.share-preview #share-card {
  position: static;
  left: auto;
  margin: 40px auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
}

#share-card {
  position: absolute;
  top: 0;
  left: -12000px;
  width: 1080px;
  height: 1350px;
  background: #ffffff;
  padding: 60px 80px 56px;
  box-sizing: border-box;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--fg);
}

#share-card .share-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#share-card .share-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

#share-card .share-head .brand-block h1 {
  font-size: 96px;
  font-weight: 800;
  letter-spacing: 4px;
  margin: 0;
  line-height: 1;
}

#share-card .share-head .brand-block .rule {
  display: block;
  width: 84px;
  height: 6px;
  background: var(--accent);
  margin: 22px 0 14px;
  border-radius: 3px;
}

#share-card .share-head .brand-block p {
  font-size: 22px;
  color: var(--muted);
  letter-spacing: 2.5px;
  margin: 0;
  text-transform: uppercase;
}

#share-card .share-head .total-block {
  text-align: right;
}

#share-card .share-head .total-block .total-num {
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 1px;
}

#share-card .share-head .total-block .total-cap {
  font-size: 22px;
  color: var(--muted);
  letter-spacing: 2px;
  margin-top: 6px;
}

#share-card .share-tag {
  margin-top: 36px;
}

#share-card .share-tag h2 {
  font-size: 76px;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: 2px;
  line-height: 1.05;
}

#share-card .share-tag .oneliner {
  font-size: 30px;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

#share-card .share-tag .sc {
  margin-top: 16px;
  color: var(--warn);
  font-size: 24px;
  line-height: 1.45;
}

#share-card .share-radar-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 22px;
}

#share-card #share-radar {
  width: 560px;
  height: 560px;
  overflow: visible;
}

#share-card #share-radar .radar-label { font-size: 22px; }
#share-card #share-radar .radar-tick { font-size: 14px; }

#share-card .share-dims {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px 36px;
}

#share-card .share-dims li {
  position: relative;
  display: flex;
  justify-content: space-between;
  font-size: 24px;
  padding: 6px 0 12px;
  border-bottom: 2px solid var(--line);
  --score: 0%;
}

#share-card .share-dims li::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: var(--score);
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

#share-card .share-dims li .dim-score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#share-card .share-foot {
  margin-top: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 20px;
  color: var(--muted);
  letter-spacing: 2px;
}

#share-card .share-foot .d6 strong { color: var(--fg); font-weight: 600; }
#share-card .share-foot .url { letter-spacing: 1.5px; }

/* Responsive */

@media (max-width: 540px) {
  .brand { font-size: 44px; }
  .lead { font-size: 16px; }
  .options.likert {
    flex-direction: column;
  }
  .options.likert .option { padding: 12px 14px; text-align: left; }
  .dim-list { grid-template-columns: 1fr; }
  .result-header { flex-direction: column; gap: 6px; }
  .main-tag { font-size: 22px; }
}
