:root {
  --bg: #f5f7f2;
  --panel: #ffffff;
  --ink: #20262a;
  --muted: #65706b;
  --line: #dce4dc;
  --green: #24745c;
  --green-dark: #155443;
  --mint: #e4f3eb;
  --blue: #315f9d;
  --blue-soft: #e7eefb;
  --gold: #a76c12;
  --gold-soft: #fff1d6;
  --coral: #b74e42;
  --coral-soft: #fbe8e4;
  --plum: #6e548e;
  --rose: #c1576a;
  --sky: #4b8db8;
  --shadow: 0 18px 60px rgba(30, 40, 34, 0.11);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(36, 116, 92, 0.12), transparent 28%),
    linear-gradient(135deg, #f7f8f3 0%, #eef4ef 48%, #f6f1e7 100%);
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

body::after {
  content: "";
  position: fixed;
  inset: auto 22px 22px auto;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    -34px -42px 0 5px var(--gold),
    -78px -20px 0 4px var(--rose),
    -112px -58px 0 5px var(--sky),
    -148px -28px 0 4px var(--green),
    -184px -66px 0 5px var(--plum);
}

body.celebrate::after {
  animation: sparkle 880ms ease-out;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.admin-reset-button {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 10;
  min-height: 32px;
  border: 1px solid rgba(220, 228, 220, 0.72);
  border-radius: 999px;
  padding: 0 11px;
  color: rgba(32, 38, 42, 0.48);
  background: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.admin-reset-button:hover,
.admin-reset-button:focus-visible {
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.95);
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: end;
  min-height: 190px;
  margin-bottom: 18px;
  padding: 26px;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(rgba(21, 59, 49, 0.7), rgba(21, 59, 49, 0.78)),
    url("https://images.unsplash.com/photo-1556761175-b413da4baf72?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.intro-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 8px;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.78;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.intro-copy p:last-child {
  max-width: 640px;
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.55;
}

.privacy-note {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.privacy-note span {
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.25fr);
  gap: 18px;
  align-items: start;
}

.workspace:has(.dashboard-panel[hidden]) {
  grid-template-columns: minmax(360px, 760px);
  justify-content: center;
}

.survey-panel,
.dashboard-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
}

.survey-panel {
  position: sticky;
  top: 20px;
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.response-count,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--mint);
  white-space: nowrap;
  font-size: 13px;
}

.progress-wrap {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf7;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ede8;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), var(--green), var(--gold));
  transition: width 220ms ease;
}

.question-list,
#questions {
  display: grid;
  gap: 18px;
}

.utility-row {
  display: flex;
  justify-content: flex-end;
}

.subtle-button {
  min-height: 36px;
  color: var(--muted);
  background: #f8fbf7;
  font-size: 13px;
}

.question-card {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(75, 141, 184, 0.08), transparent 44%),
    linear-gradient(315deg, rgba(193, 87, 106, 0.08), transparent 38%),
    #fbfcfa;
}

.question-illustration {
  position: relative;
  margin: 12px 0 16px;
  overflow: hidden;
  border: 1px solid rgba(220, 228, 220, 0.8);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(75, 141, 184, 0.13), transparent 42%),
    linear-gradient(315deg, rgba(245, 194, 91, 0.2), transparent 45%),
    #fffdf8;
}

.question-illustration svg {
  display: block;
  width: 100%;
  height: 132px;
}

.question-card legend {
  width: 100%;
  padding: 0 0 12px;
  color: var(--ink);
  line-height: 1.5;
}

.question-card legend strong {
  display: block;
  font-size: 22px;
  line-height: 1.4;
}

.summary-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(36, 116, 92, 0.1), transparent 42%),
    linear-gradient(315deg, rgba(245, 194, 91, 0.16), transparent 38%),
    #fbfcfa;
}

.summary-card h3 {
  margin: 0;
  font-size: 26px;
}

.summary-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.summary-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 8px;
  color: var(--green-dark);
  background: var(--mint);
}

.summary-score span {
  font-weight: 800;
}

.summary-score strong {
  font-size: 36px;
  line-height: 1;
}

.summary-score small {
  color: var(--muted);
  font-size: 16px;
}

.summary-list {
  display: grid;
  gap: 8px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.summary-row span {
  color: var(--muted);
}

.summary-row strong {
  white-space: nowrap;
}

.question-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 13px;
  font-weight: 800;
}

.reverse-label {
  display: inline-flex;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--plum);
  background: #efe9f6;
  font-size: 12px;
  font-weight: 700;
}

.rating-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.rating-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rating-option span {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #ffffff;
  font-weight: 800;
  transition: 160ms ease;
}

.rating-row.lively .rating-option span {
  min-height: 72px;
  gap: 4px;
  padding: 10px 6px;
}

.rating-option b {
  font-size: 25px;
  line-height: 1;
}

.rating-option small {
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.rating-option:hover span {
  border-color: rgba(36, 116, 92, 0.42);
  transform: translateY(-2px);
}

.rating-option input:checked + span {
  color: #ffffff;
  border-color: var(--green);
  background: linear-gradient(135deg, var(--green), var(--sky));
  box-shadow: 0 10px 24px rgba(36, 116, 92, 0.22);
}

.rating-option input:focus-visible + span {
  outline: 3px solid rgba(36, 116, 92, 0.25);
  outline-offset: 2px;
}

.form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
}

.primary-button {
  color: #ffffff;
  border-color: var(--green);
  background: var(--green);
  font-weight: 800;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-button:hover {
  background: var(--green-dark);
}

.secondary-button:hover {
  background: #f1f5ef;
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 31, 29, 0.42);
  backdrop-filter: blur(7px);
}

.modal-card {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.modal-card p {
  color: var(--muted);
  line-height: 1.6;
}

.modal-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.modal-card input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
}

.modal-card input:focus-visible {
  outline: 3px solid rgba(36, 116, 92, 0.25);
  outline-offset: 2px;
}

.modal-message {
  min-height: 22px;
  margin: 10px 0;
  color: var(--coral) !important;
  font-size: 13px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.locked-state {
  display: grid;
  min-height: 280px;
  place-content: center;
  padding: 34px;
  border: 1px dashed #b6c6b8;
  border-radius: 8px;
  background: #f8fbf7;
  text-align: center;
}

.locked-state strong {
  font-size: 22px;
}

.locked-state p {
  max-width: 420px;
  margin: 10px auto 0;
  color: var(--muted);
  line-height: 1.7;
}

.dashboard {
  display: grid;
  gap: 16px;
}

.score-board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  gap: 12px;
}

.radar-card,
.score-detail,
.insight-card,
.chart-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.radar-card,
.score-detail {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.radar-chart {
  min-height: 260px;
}

.radar-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.radar-grid polygon {
  fill: none;
  stroke: #dce4dc;
  stroke-width: 1;
}

.radar-grid line {
  stroke: #e4ebe4;
  stroke-width: 1;
}

.radar-fill {
  fill: rgba(36, 116, 92, 0.22);
  stroke: none;
}

.radar-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linejoin: round;
}

.radar-dots circle {
  fill: var(--green);
  stroke: #ffffff;
  stroke-width: 2;
}

.radar-labels text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.score-detail span,
.section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.score-detail strong {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1;
}

.score-detail b {
  font-size: 64px;
  letter-spacing: 0;
}

.score-detail .compact-score b {
  font-size: 38px;
}

.score-detail small {
  color: var(--muted);
  font-size: 18px;
}

.insight-card {
  padding: 18px;
  border-left: 6px solid var(--green);
}

.insight-card[data-tone="blue"] {
  border-left-color: var(--blue);
}

.insight-card[data-tone="gold"] {
  border-left-color: var(--gold);
}

.insight-card[data-tone="coral"] {
  border-left-color: var(--coral);
}

.insight-card span {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--mint);
  font-size: 13px;
  font-weight: 800;
}

.insight-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.chart-section {
  padding: 18px;
}

.distribution,
.dimension-list {
  display: grid;
  gap: 12px;
}

.distribution-row,
.dimension-row {
  display: grid;
  grid-template-columns: 128px 1fr 64px;
  gap: 12px;
  align-items: center;
}

.track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eee8;
}

.track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 240ms ease;
}

.track.blue span {
  background: var(--blue);
}

.track.gold span {
  background: var(--gold);
}

.track.coral span {
  background: var(--coral);
}

.row-value {
  color: var(--muted);
  text-align: right;
  font-size: 13px;
  white-space: nowrap;
}


@media (max-width: 1080px) {
  .intro-band,
  .workspace {
    grid-template-columns: 1fr;
  }

  .survey-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px;
  }

  .intro-band {
    min-height: 150px;
    gap: 12px;
  }

  .intro-band,
  .survey-panel,
  .dashboard-panel {
    padding: 18px;
  }

  h1 {
    font-size: 36px;
  }

  .intro-copy p:last-child {
    font-size: 15px;
  }

  .privacy-note {
    padding: 12px;
  }

  .form-actions,
  .score-board {
    grid-template-columns: 1fr;
  }

  .rating-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .rating-row.lively .rating-option span {
    min-height: 62px;
  }

  .rating-option b {
    font-size: 21px;
  }

  .rating-option small {
    font-size: 10px;
  }

  .question-illustration {
    min-height: 118px;
  }

  .question-card legend strong {
    font-size: 18px;
  }

  .distribution-row,
  .dimension-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .row-value {
    text-align: left;
  }
}

@keyframes sparkle {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.2);
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(-30px) scale(1);
  }
}
