:root {
  --ink: #171716;
  --ink-soft: #595752;
  --ink-muted: #7b7871;
  --paper: #f4f1ec;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #fffdfa;
  --line: rgba(29, 27, 24, 0.1);
  --line-strong: rgba(29, 27, 24, 0.17);
  --accent: #d66a48;
  --accent-dark: #a9462c;
  --accent-soft: #f6dfd6;
  --brand-navy: #0b4065;
  --brand-cyan: #43d5e6;
  --blue: #496cba;
  --blue-soft: #e8eefb;
  --sage: #4e746a;
  --sage-soft: #e2eee9;
  --danger: #b33e35;
  --danger-soft: #fbe9e7;
  --shadow-sm: 0 1px 2px rgba(38, 31, 25, 0.04), 0 8px 30px rgba(38, 31, 25, 0.06);
  --shadow-lg: 0 20px 70px rgba(45, 34, 27, 0.11);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --content-width: 780px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% -10%, rgba(214, 106, 72, 0.11), transparent 34rem),
    radial-gradient(circle at 95% 18%, rgba(73, 108, 186, 0.09), transparent 30rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Noto Sans TC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
label,
input[type="radio"],
input[type="checkbox"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22;
  pointer-events: none;
}

.ambient-one {
  top: 20%;
  left: -240px;
  background: #efb3a0;
}

.ambient-two {
  right: -240px;
  bottom: 5%;
  background: #b5c7ee;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid rgba(29, 27, 24, 0.075);
  background: rgba(244, 241, 236, 0.78);
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(11, 64, 101, 0.08), 0 7px 20px rgba(11, 64, 101, 0.12);
}

.brand-mark img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--brand-navy);
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--sage);
  font-size: 12px;
}

.save-state span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5c9687;
  box-shadow: 0 0 0 4px rgba(92, 150, 135, 0.11);
}

.save-state.saving span {
  animation: pulse 0.8s infinite alternate;
}

.language-control select {
  min-height: 42px;
  padding: 0 35px 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background-color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.main-layout {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 82px);
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 52px 0 84px;
}

.journey-panel {
  position: sticky;
  top: 128px;
  align-self: start;
  min-height: 300px;
}

.journey-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.49);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.journey-card .eyebrow {
  margin-bottom: 8px;
}

.journey-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.journey-card > p {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.step-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
}

.step-list li::before {
  content: "";
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
}

.step-list li::after {
  content: "";
  position: absolute;
  top: 32px;
  left: 11px;
  width: 1px;
  height: 20px;
  background: var(--line);
}

.step-list li:last-child::after {
  display: none;
}

.step-list li.active {
  color: var(--ink);
}

.step-list li.active::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.step-list li.done::before {
  border-color: var(--sage);
  background: var(--sage);
  box-shadow: inset 0 0 0 6px #fff;
}

.content-panel {
  width: min(100%, var(--content-width));
}

.welcome-screen,
.form-screen,
.success-screen {
  animation: enter 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

.welcome-hero {
  position: relative;
  padding: clamp(30px, 6vw, 58px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.92), rgba(255, 253, 250, 0.66)),
    var(--surface);
  box-shadow: var(--shadow-lg);
}

.hero-brand-mark {
  position: absolute;
  top: 28px;
  right: 24px;
  width: min(24%, 170px);
  height: auto;
  opacity: 0.055;
  pointer-events: none;
  user-select: none;
}

.welcome-hero h1,
.screen-header h1,
.success-screen h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.065em;
}

.welcome-hero .lead {
  max-width: 610px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.72;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 28px 0 32px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.trust-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.48);
}

.trust-item strong,
.trust-item span {
  display: block;
}

.trust-item strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.trust-item span {
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.5;
}

.screen-header {
  margin-bottom: 28px;
}

.screen-header h1 {
  font-size: clamp(32px, 5vw, 48px);
}

.screen-header > p {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.72;
}

.progress-wrap {
  margin-bottom: 34px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 650;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(29, 27, 24, 0.08);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #e99a75);
  transition: width 0.35s ease;
}

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

.question-card {
  padding: clamp(21px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.question-card:focus-within {
  border-color: rgba(214, 106, 72, 0.5);
}

.question-card.invalid {
  border-color: rgba(179, 62, 53, 0.55);
  background: linear-gradient(0deg, rgba(251, 233, 231, 0.44), rgba(255, 255, 255, 0.8));
  animation: shake 0.32s ease;
}

.question-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.question-title-row h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: -0.025em;
}

.required-badge,
.optional-badge {
  flex: none;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.required-badge {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.optional-badge {
  color: var(--ink-muted);
  background: rgba(29, 27, 24, 0.06);
}

.question-help {
  margin: -7px 0 16px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
}

.text-input,
.textarea-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-input {
  height: 50px;
  padding: 0 15px;
}

.textarea-input {
  min-height: 126px;
  padding: 14px 15px;
  line-height: 1.55;
  resize: vertical;
}

.text-input:focus,
.textarea-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(214, 106, 72, 0.12);
}

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

.option-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.17s ease, background 0.17s ease, transform 0.17s ease;
}

.option-card:hover {
  border-color: rgba(214, 106, 72, 0.4);
  transform: translateY(-1px);
}

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

.option-indicator {
  position: relative;
  flex: none;
  width: 19px;
  height: 19px;
  border: 1.5px solid rgba(29, 27, 24, 0.24);
  border-radius: 6px;
  background: #fff;
}

.option-card.radio .option-indicator {
  border-radius: 50%;
}

.option-card.selected {
  border-color: rgba(214, 106, 72, 0.62);
  color: var(--ink);
  background: rgba(246, 223, 214, 0.62);
}

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

.option-card.selected .option-indicator::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 5px;
  width: 6px;
  height: 3px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  transform: rotate(-45deg);
}

.option-card.radio.selected .option-indicator::after {
  top: 5px;
  left: 5px;
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

.error-text {
  margin: 11px 0 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

.form-actions {
  position: sticky;
  bottom: 18px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding: 12px;
  border: 1px solid rgba(29, 27, 24, 0.08);
  border-radius: 18px;
  background: rgba(255, 253, 250, 0.78);
  box-shadow: 0 14px 44px rgba(38, 31, 25, 0.12);
  backdrop-filter: blur(22px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 750;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 10px 24px rgba(20, 18, 16, 0.18);
}

.button-primary:hover {
  box-shadow: 0 13px 30px rgba(20, 18, 16, 0.25);
}

.button-accent {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(169, 70, 44, 0.22);
}

.button-ghost {
  color: var(--ink-soft);
  background: rgba(29, 27, 24, 0.055);
}

.button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.review-list {
  display: grid;
  gap: 14px;
}

.review-section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.review-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.review-section h2 {
  margin: 0;
  font-size: 17px;
}

.edit-link {
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

.review-item dt {
  margin-bottom: 5px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 650;
}

.review-item dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.5;
}

.review-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 13px;
  color: var(--ink-soft);
  background: var(--sage-soft);
  font-size: 12px;
  line-height: 1.6;
}

.success-screen {
  padding: clamp(30px, 6vw, 58px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin: 0 auto 24px;
  border-radius: 24px;
  color: #fff;
  background: var(--sage);
  box-shadow: 0 14px 36px rgba(78, 116, 106, 0.25);
  font-size: 30px;
  font-weight: 800;
}

.success-screen h1 {
  font-size: clamp(32px, 5vw, 46px);
}

.success-screen > p {
  max-width: 520px;
  margin: 16px auto 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.reference-card {
  max-width: 440px;
  margin: 26px auto;
  padding: 17px;
  border: 1px dashed rgba(78, 116, 106, 0.42);
  border-radius: 15px;
  background: var(--sage-soft);
}

.reference-card span,
.reference-card strong {
  display: block;
}

.reference-card span {
  margin-bottom: 5px;
  color: var(--ink-muted);
  font-size: 11px;
}

.reference-card strong {
  font-size: 17px;
  letter-spacing: 0.08em;
}

.success-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 16px;
  border-radius: 13px;
  color: #fff;
  background: rgba(23, 23, 22, 0.92);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 13px;
  font-weight: 650;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  to {
    opacity: 0.35;
  }
}

@keyframes shake {
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

@media (max-width: 920px) {
  .main-layout {
    display: block;
    width: min(100% - 36px, 780px);
    padding-top: 32px;
  }

  .journey-panel {
    display: none;
    min-height: 0;
    margin: 0;
  }

  .content-panel {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 66px;
    padding: 9px 14px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand strong {
    font-size: 14px;
  }

  .hero-brand-mark {
    top: 18px;
    right: 12px;
    width: 105px;
    opacity: 0.045;
  }

  .brand small,
  .save-state {
    display: none;
  }

  .topbar-actions {
    gap: 7px;
  }

  .language-control select {
    min-height: 40px;
    max-width: 146px;
    padding-left: 11px;
    font-size: 12px;
  }

  .main-layout {
    width: min(100% - 24px, 780px);
    padding: 22px 0 calc(96px + env(safe-area-inset-bottom));
  }

  .welcome-hero,
  .success-screen {
    padding: 26px 21px;
    border-radius: 25px;
  }

  .welcome-hero h1,
  .screen-header h1,
  .success-screen h1 {
    font-size: 34px;
  }

  .welcome-hero .lead {
    font-size: 15px;
  }

  .trust-row {
    grid-template-columns: 1fr;
  }

  .trust-item {
    padding: 14px 16px;
  }

  .option-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .question-card {
    padding: 20px 17px;
    border-radius: 19px;
  }

  .question-title-row {
    display: block;
  }

  .question-title-row h2 {
    font-size: 16px;
  }

  .required-badge,
  .optional-badge {
    display: inline-block;
    margin-top: 9px;
  }

  .option-card {
    min-height: 52px;
  }

  .form-actions {
    position: fixed;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 10px;
    margin: 0;
    padding: 9px;
  }

  .form-actions .button {
    flex: 1;
    min-height: 48px;
    padding: 0 14px;
    font-size: 13px;
  }

  .toast {
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
  }
}

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