:root {
  --forest: #153f38;
  --forest-deep: #0d2f2a;
  --forest-soft: #e9f1ec;
  --paper: #fffdf9;
  --canvas: #f3eee7;
  --rose: #d55f7d;
  --rose-deep: #ab3d5c;
  --rose-soft: #fce8ed;
  --gold: #d8a84e;
  --ink: #252b29;
  --muted: #68706d;
  --line: #dedbd3;
  --danger: #b73e4d;
  --shadow: 0 28px 80px rgba(27, 46, 40, 0.14);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

button, input, textarea { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.page-glow {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.page-glow-one {
  width: 560px;
  height: 560px;
  top: -310px;
  right: -130px;
  background: radial-gradient(circle, rgba(213, 95, 125, 0.23), transparent 68%);
}

.page-glow-two {
  width: 620px;
  height: 620px;
  bottom: -360px;
  left: -260px;
  background: radial-gradient(circle, rgba(21, 63, 56, 0.18), transparent 68%);
}

.survey-header {
  width: min(1180px, calc(100% - 48px));
  min-height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--forest);
  text-decoration: none;
}

.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.12; }
.brand strong { font-family: "Songti TC", "Noto Serif TC", serif; font-size: 18px; letter-spacing: 0.06em; }
.brand small { margin-top: 5px; font-size: 10px; font-weight: 700; letter-spacing: 0.14em; opacity: 0.62; }

.brand-flower { position: relative; width: 40px; height: 40px; display: block; transform: rotate(45deg); }
.brand-flower i { position: absolute; width: 17px; height: 17px; border-radius: 65% 35% 65% 35%; background: var(--rose); }
.brand-flower i:nth-child(1) { left: 2px; top: 2px; }
.brand-flower i:nth-child(2) { right: 2px; top: 2px; transform: rotate(90deg); }
.brand-flower i:nth-child(3) { right: 2px; bottom: 2px; transform: rotate(180deg); }
.brand-flower i:nth-child(4) { left: 2px; bottom: 2px; transform: rotate(270deg); }
.brand-flower b { position: absolute; width: 10px; height: 10px; left: 15px; top: 15px; border-radius: 50%; background: var(--gold); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--forest);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.back-link span { transition: transform 0.2s ease; }
.back-link:hover span { transform: translateX(-4px); }

.survey-layout {
  width: min(1180px, calc(100% - 48px));
  margin: 16px auto 60px;
  display: grid;
  grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.55fr);
  gap: 34px;
  align-items: start;
}

.survey-intro {
  position: sticky;
  top: 24px;
  min-height: 660px;
  padding: 52px 46px 42px;
  overflow: hidden;
  border-radius: 30px;
  color: white;
  background:
    radial-gradient(circle at 85% 12%, rgba(237, 170, 187, 0.18), transparent 24%),
    linear-gradient(150deg, var(--forest), var(--forest-deep));
  box-shadow: var(--shadow);
}

.survey-intro::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -130px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(255, 255, 255, 0.025), 0 0 0 78px rgba(255, 255, 255, 0.02);
}

.eyebrow {
  margin: 0 0 14px;
  color: #efbdc9;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.survey-intro h1 {
  margin: 0;
  font-family: "Songti TC", "Noto Serif TC", serif;
  font-size: clamp(36px, 3.5vw, 46px);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.045em;
  word-break: keep-all;
}

.intro-copy {
  max-width: 390px;
  margin: 19px 0 34px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
}

.journey { margin: 0; padding: 0; list-style: none; }
.journey li { position: relative; display: flex; gap: 14px; min-height: 70px; opacity: 0.42; transition: opacity 0.3s ease; }
.journey li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 39px; width: 1px; height: 29px; background: rgba(255, 255, 255, 0.3); }
.journey li.active, .journey li.complete { opacity: 1; }
.journey li > span { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.52); border-radius: 50%; font: 700 12px/1 Georgia, serif; }
.journey li.active > span { border-color: #efbdc9; background: var(--rose); box-shadow: 0 0 0 5px rgba(213, 95, 125, 0.16); }
.journey li.complete > span { border-color: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.14); }
.journey li div { display: flex; flex-direction: column; padding-top: 1px; }
.journey strong { font-size: 15px; }
.journey small { margin-top: 2px; color: rgba(255, 255, 255, 0.58); font-size: 12px; }

.privacy-note {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 15px;
  padding: 14px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.privacy-note > span { color: #efbdc9; font-size: 20px; line-height: 1.2; }
.privacy-note p { margin: 0; color: rgba(255, 255, 255, 0.68); font-size: 12px; line-height: 1.65; }
.privacy-note strong { display: block; margin-bottom: 2px; color: white; font-size: 13px; }

.survey-card {
  min-height: 720px;
  padding: 38px clamp(24px, 5vw, 64px) 46px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 30px;
  background: rgba(255, 253, 249, 0.95);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.card-topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.card-topline > div { display: flex; flex-direction: column; }
.card-topline span { color: var(--muted); font-size: 12px; font-weight: 700; }
.card-topline strong { margin-top: 2px; color: var(--forest); font-size: 15px; }
.card-topline b { color: var(--rose-deep); font: 700 17px/1 Georgia, serif; }

.progress-track { height: 4px; margin: 14px 0 42px; overflow: hidden; border-radius: 99px; background: #e8e4dd; }
.progress-track i { display: block; width: 25%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--rose), #ee9aad); transition: width 0.35s ease; }

.form-step { animation: stepIn 0.35s ease both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.step-heading { margin-bottom: 36px; }
.step-heading p { margin: 0; color: var(--rose-deep); font-size: 12px; font-weight: 800; letter-spacing: 0.14em; }
.step-heading h2 { margin: 7px 0 7px; font-family: "Songti TC", "Noto Serif TC", serif; font-size: clamp(28px, 3.4vw, 39px); line-height: 1.3; letter-spacing: -0.035em; }
.step-heading > span { color: var(--muted); font-size: 14px; }

.question-block {
  display: block;
  margin: 0;
  padding: 30px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.question-block:first-of-type { padding-top: 0; border-top: 0; }
.question-block legend, .question-title { width: 100%; margin-bottom: 17px; padding: 0; color: var(--ink); font-size: 17px; font-weight: 750; }
.question-block legend > span, .question-title > b { margin-right: 8px; color: var(--rose-deep); font: 700 14px/1 Georgia, serif; }
.question-block em, .question-title em { margin-left: 8px; color: var(--muted); font-size: 12px; font-style: normal; font-weight: 500; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-stack { display: grid; gap: 10px; }
.choice-stack.roomy { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.choice { position: relative; display: flex; min-height: 50px; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #4d5552;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.choice > span::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1.5px solid #b8bcb8;
  border-radius: 5px;
  background: white;
  box-shadow: inset 0 0 0 4px white;
}

.choice input[type="radio"] + span::before { border-radius: 50%; }
.choice:hover > span { border-color: #bdcec4; transform: translateY(-1px); }
.choice input:focus-visible + span { outline: 3px solid rgba(213, 95, 125, 0.22); outline-offset: 2px; }
.choice input:checked + span { border-color: #91ad9c; background: var(--forest-soft); color: var(--forest); }
.choice input:checked + span::before { border-color: var(--forest); background: var(--forest); box-shadow: inset 0 0 0 4px white; }
.choice-stack.roomy .choice > span { align-items: flex-start; flex-wrap: wrap; padding: 14px 16px; }
.choice-stack.roomy .choice > span::before { margin-top: 2px; }
.choice-stack.roomy .choice b { flex: 1; font-size: 14px; }
.choice-stack.roomy .choice small { width: calc(100% - 26px); margin: -3px 0 0 26px; color: var(--muted); font-size: 12px; font-weight: 500; }

.other-input, textarea {
  width: 100%;
  margin-top: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  color: var(--ink);
  font-size: 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.other-input { height: 50px; padding: 0 15px; }
textarea { display: block; padding: 14px 16px; resize: vertical; line-height: 1.7; }
.other-input:disabled { display: none; }
.other-input:focus, textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 4px var(--rose-soft); }
textarea::placeholder, .other-input::placeholder { color: #9a9f9c; }

.field-error { display: none; margin-top: 9px; color: var(--danger); font-size: 13px; font-weight: 650; }
.question-block.has-error .field-error { display: block; }
.question-block.has-error textarea, .question-block.has-error .other-input:not(:disabled) { border-color: var(--danger); }

.scale-labels { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.scale-options { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.scale-options::before { content: ""; position: absolute; z-index: 0; left: 9%; right: 9%; top: 25px; height: 2px; background: #dddcd6; }
.scale-options label { position: relative; z-index: 1; cursor: pointer; }
.scale-options input { position: absolute; opacity: 0; }
.scale-options span { width: 51px; height: 51px; margin: 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--forest); font: 700 16px/1 Georgia, serif; transition: 0.18s ease; }
.scale-options input:checked + span { border-color: var(--rose); background: var(--rose); color: white; transform: scale(1.08); box-shadow: 0 8px 18px rgba(213, 95, 125, 0.24); }
.scale-options input:focus-visible + span { outline: 3px solid rgba(213, 95, 125, 0.22); outline-offset: 2px; }

.highlight-question { margin-top: 10px; padding: 27px; border: 1px solid #efcad3 !important; border-radius: 18px; background: linear-gradient(135deg, #fff4f6, #fffdf9); }

.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 27px; border-top: 1px solid var(--line); }
.button { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 24px; border: 0; border-radius: 13px; font-size: 14px; font-weight: 800; transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible, .text-button:focus-visible { outline: 3px solid rgba(213, 95, 125, 0.27); outline-offset: 3px; }
.button-primary { margin-left: auto; background: var(--forest); color: white; box-shadow: 0 10px 24px rgba(21, 63, 56, 0.18); }
.button-primary:hover { background: #1c5147; box-shadow: 0 13px 28px rgba(21, 63, 56, 0.24); }
.button-secondary { border: 1px solid var(--line); background: transparent; color: var(--forest); }
.finish-button { background: var(--rose); box-shadow: 0 10px 24px rgba(213, 95, 125, 0.22); }
.finish-button:hover { background: var(--rose-deep); }

.result-view { padding: 26px 0 4px; text-align: center; animation: stepIn 0.45s ease both; }
.result-celebration { width: 58px; height: 58px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; background: var(--rose-soft); color: var(--rose); font-size: 25px; box-shadow: 0 0 0 10px rgba(252, 232, 237, 0.58); }
.result-view h2 { max-width: 600px; margin: 5px auto 8px; font-family: "Songti TC", "Noto Serif TC", serif; font-size: clamp(30px, 4vw, 43px); line-height: 1.3; letter-spacing: -0.035em; }
.result-intro { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 14px; }

.signal-grid { display: grid; grid-template-columns: 1.2fr 0.7fr 1fr; gap: 10px; margin: 33px 0 18px; text-align: left; }
.signal-grid article { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.signal-grid small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.signal-grid strong { margin-top: 4px; display: block; overflow: hidden; color: var(--forest); font-size: 14px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }

.copy-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; text-align: left; }
.copy-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 17px 20px; border-bottom: 1px solid var(--line); background: #f6f4ef; }
.copy-panel-heading > div { display: flex; flex-direction: column; }
.copy-panel-heading small { color: var(--muted); font-size: 11px; }
.copy-panel-heading strong { color: var(--forest); font-size: 14px; }
.copy-panel-heading > span { padding: 5px 9px; border-radius: 99px; background: var(--forest-soft); color: var(--forest); font-size: 11px; font-weight: 700; }
#resultText { max-height: 390px; margin: 0; padding: 22px; overflow: auto; color: #39413e; font: 14px/1.8 "PingFang TC", "Noto Sans TC", sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }

.result-actions { display: flex; flex-direction: column; align-items: center; gap: 13px; margin-top: 23px; }
.button-copy { width: min(100%, 390px); background: var(--rose); color: white; box-shadow: 0 12px 30px rgba(213, 95, 125, 0.24); }
.button-copy.copied { background: var(--forest); }
.text-button { border: 0; background: none; color: var(--forest); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.copy-status { min-height: 24px; margin: 10px 0 0; color: var(--forest); font-size: 13px; font-weight: 700; }

footer { padding: 10px 24px 38px; color: #777d79; font-size: 12px; text-align: center; }

[hidden] { display: none !important; }

@media (max-width: 940px) {
  .survey-layout { grid-template-columns: 1fr; }
  .survey-intro { position: relative; top: 0; min-height: 0; padding: 40px; }
  .survey-intro h1 br { display: none; }
  .journey { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 28px; }
  .journey li { min-height: 0; flex-direction: column; gap: 8px; }
  .journey li:not(:last-child)::after { left: 36px; right: 6px; top: 17px; width: auto; height: 1px; }
  .journey li div { padding-right: 10px; }
  .journey li small { display: none; }
  .privacy-note { max-width: 600px; margin-top: 28px; }
}

@media (max-width: 680px) {
  .survey-header { width: min(100% - 30px, 1180px); min-height: 76px; }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 9px; }
  .brand-flower { width: 34px; height: 34px; transform: rotate(45deg) scale(0.84); }
  .back-link { font-size: 13px; }
  .survey-layout { width: min(100% - 22px, 1180px); margin-top: 4px; gap: 14px; }
  .survey-intro { padding: 31px 24px 27px; border-radius: 22px; }
  .survey-intro h1 { font-size: 33px; }
  .intro-copy { margin-bottom: 23px; font-size: 14px; }
  .journey { gap: 3px; }
  .journey li { align-items: center; text-align: center; }
  .journey li:not(:last-child)::after { left: calc(50% + 17px); right: calc(-50% + 17px); }
  .journey li > span { width: 33px; height: 33px; }
  .journey strong { font-size: 11px; }
  .privacy-note { display: none; }
  .survey-card { min-height: 0; padding: 26px 19px 31px; border-radius: 22px; }
  .progress-track { margin-bottom: 30px; }
  .step-heading { margin-bottom: 30px; }
  .step-heading h2 { font-size: 28px; }
  .choice-grid, .compact-grid, .choice-stack.roomy { grid-template-columns: 1fr; }
  .choice > span { font-size: 15px; }
  .question-block { padding: 27px 0; }
  .question-block legend, .question-title { font-size: 16px; }
  .highlight-question { padding: 20px 16px; }
  .scale-options { gap: 5px; }
  .scale-options span { width: 45px; height: 45px; }
  .scale-options::before { top: 22px; }
  .form-actions { position: sticky; z-index: 3; bottom: 0; margin: 16px -9px -15px; padding: 18px 9px 15px; background: linear-gradient(transparent, var(--paper) 24%); }
  .button { min-height: 50px; padding: 0 18px; }
  .signal-grid { grid-template-columns: 1fr; }
  .signal-grid strong { white-space: normal; }
  .copy-panel-heading { align-items: flex-start; }
  #resultText { max-height: 440px; padding: 18px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
