:root {
  --forest: #28483a;
  --forest-deep: #173329;
  --forest-soft: #dfe9df;
  --cream: #f7f3e9;
  --paper: #fffdf7;
  --ink: #26352e;
  --muted: #68736c;
  --line: #d9dfd6;
  --rose: #d96d86;
  --rose-soft: #f9e4e8;
  --gold: #c79a43;
  --gold-soft: #f4e7c9;
  --shadow: 0 24px 70px rgba(33, 58, 46, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--cream);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.page-glow { position: fixed; border-radius: 50%; filter: blur(2px); pointer-events: none; z-index: -1; }
.page-glow-one { width: 22rem; height: 22rem; top: -11rem; right: -9rem; background: rgba(232, 167, 184, 0.25); }
.page-glow-two { width: 24rem; height: 24rem; bottom: -14rem; left: -13rem; background: rgba(125, 157, 127, 0.2); }

.planner-header {
  height: 72px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(40, 72, 58, 0.1);
  background: rgba(255, 253, 247, 0.88);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.planner-brand { display: block; width: 160px; height: 52px; overflow: hidden; }
.planner-brand img { width: 210px; height: 52px; object-fit: contain; transform: translateX(-24px); }
.home-link { color: var(--forest); font-weight: 750; font-size: 0.92rem; }

.planner-shell { width: min(100% - 28px, 880px); margin: 0 auto; padding: 28px 0 70px; }
.welcome-card, .question-card, .result-view { border: 1px solid rgba(255, 255, 255, 0.9); background: rgba(255, 253, 247, 0.92); box-shadow: var(--shadow); }
.welcome-card { border-radius: 30px; padding: 34px 24px 26px; text-align: center; overflow: hidden; position: relative; }
.welcome-card::after { content: ""; position: absolute; width: 190px; height: 190px; border: 1px solid rgba(199, 154, 67, 0.25); border-radius: 50%; top: -105px; left: -95px; }
.welcome-kicker, .step-meta, .result-kicker, .section-title-row span { color: var(--rose); font-size: 0.76rem; font-weight: 850; letter-spacing: 0.14em; }
.welcome-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 18px auto 12px; border-radius: 50%; color: var(--gold); background: var(--gold-soft); font-size: 1.8rem; }
.welcome-card h1, .result-heading h1 { margin: 0; color: var(--forest-deep); font-family: "Songti TC", "Noto Serif TC", Georgia, serif; font-size: clamp(2.25rem, 10vw, 4.3rem); line-height: 1.16; letter-spacing: -0.05em; }
.welcome-card h1 em { color: var(--rose); font-style: normal; }
.welcome-lead { margin: 22px auto 0; max-width: 610px; color: #45564d; font-size: 1rem; line-height: 1.9; }
.welcome-note { color: var(--forest); font-weight: 750; }

.primary-action, .secondary-action, .danger-action, .copy-action, .line-action {
  min-height: 50px;
  border-radius: 999px;
  border: 0;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.primary-action { color: #fff; background: var(--forest); box-shadow: 0 14px 30px rgba(40, 72, 58, 0.22); }
.welcome-card > .primary-action { width: 100%; margin-top: 14px; }
.primary-action:hover, .line-action:hover { transform: translateY(-2px); background: var(--forest-deep); }
.primary-action.compact { min-width: 132px; }
.secondary-action { color: var(--forest); background: transparent; border: 1px solid #b9c7bc; }
.secondary-action:hover { background: var(--forest-soft); }
.danger-action { color: #a4455c; background: var(--rose-soft); }
.copy-action { min-height: 42px; color: #fff; background: var(--forest); font-size: 0.9rem; }
.line-action { color: #fff; background: var(--forest); text-align: center; }
.primary-action:focus-visible, .secondary-action:focus-visible, .danger-action:focus-visible, .copy-action:focus-visible, .line-action:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(217, 109, 134, 0.35); outline-offset: 3px; }

.privacy-row { margin: 22px auto 0; max-width: 610px; padding: 14px 16px; display: flex; align-items: flex-start; gap: 10px; border-radius: 16px; color: var(--forest); background: var(--forest-soft); text-align: left; }
.privacy-row span { font-size: 1.4rem; line-height: 1; }
.privacy-row p { margin: 0; font-size: 0.88rem; line-height: 1.65; }
.disclaimer { margin-top: 18px; color: var(--muted); font-size: 0.78rem; line-height: 1.6; }

.progress-area { margin-bottom: 15px; }
.progress-copy { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 0.86rem; }
.progress-copy strong { color: var(--forest); }
.progress-track { height: 8px; border-radius: 99px; background: #e3e5dd; overflow: hidden; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--rose), var(--gold)); transition: width 0.32s ease; }

.question-card { border-radius: 26px; padding: 26px 20px 22px; }
.question-card h2 { margin: 9px 0 0; color: var(--forest-deep); font-family: "Songti TC", "Noto Serif TC", Georgia, serif; font-size: clamp(1.75rem, 7vw, 2.7rem); line-height: 1.3; letter-spacing: -0.035em; }
.step-description { margin: 10px 0 0; color: var(--muted); line-height: 1.75; }
.question-list { margin-top: 24px; display: grid; gap: 26px; }
.question-block { border: 0; margin: 0; padding: 0; min-width: 0; }
.question-block legend, .question-label { display: block; width: 100%; margin-bottom: 12px; color: var(--ink); font-size: 1.03rem; font-weight: 800; line-height: 1.55; }
.question-number { margin-right: 6px; color: var(--rose); }
.question-hint { display: block; margin-top: -5px; margin-bottom: 12px; color: var(--muted); font-size: 0.84rem; line-height: 1.55; }
.choice-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.choice {
  min-height: 56px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  line-height: 1.45;
  transition: 0.18s ease;
}
.choice:hover { border-color: #9db09f; background: #f8faf6; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-dot { width: 20px; height: 20px; flex: 0 0 20px; border: 2px solid #9bad9f; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 4px #fff; }
.choice.checkbox .choice-dot { border-radius: 6px; }
.choice:has(input:checked) { border-color: var(--forest); background: var(--forest-soft); box-shadow: inset 0 0 0 1px var(--forest); }
.choice:has(input:checked) .choice-dot { border-color: var(--forest); background: var(--forest); }
.choice.checkbox:has(input:checked) .choice-dot::after { content: "✓"; display: grid; place-items: center; color: #fff; font-size: 0.75rem; font-weight: 900; line-height: 1; }
.choice-text { flex: 1; font-weight: 650; }

.custom-input, .text-input {
  width: 100%;
  min-height: 54px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0 15px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.custom-input:focus, .text-input:focus { border-color: var(--forest); box-shadow: 0 0 0 4px rgba(40, 72, 58, 0.09); }
.custom-input-wrap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; }
.custom-input-wrap .custom-input { margin-top: 0; }
.input-unit { color: var(--muted); font-size: 0.9rem; font-weight: 700; }

.selection-counter { margin-top: 10px; color: var(--muted); font-size: 0.84rem; text-align: right; }
.form-error { margin: 20px 0 0; padding: 12px 14px; border-radius: 13px; color: #9b3f56; background: var(--rose-soft); font-size: 0.9rem; line-height: 1.55; }
.step-actions { margin-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.autosave-status { margin: 11px 5px 0; color: var(--muted); font-size: 0.78rem; text-align: center; }

.result-view { border-radius: 30px; padding: 28px 18px 24px; }
.result-heading { text-align: center; }
.result-heading h1 { margin-top: 8px; font-size: clamp(2rem, 9vw, 3.7rem); }
.result-heading p { max-width: 650px; margin: 14px auto 0; color: var(--muted); line-height: 1.75; }
.top-goals { margin: 22px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.top-goals span { padding: 8px 12px; border-radius: 99px; color: #8c5d19; background: var(--gold-soft); font-size: 0.86rem; font-weight: 800; }
.result-summary-grid { margin-top: 26px; display: grid; gap: 12px; }
.summary-card { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.summary-card span { color: var(--muted); font-size: 0.84rem; font-weight: 750; }
.summary-card strong { display: block; margin-top: 8px; color: var(--forest-deep); font-size: clamp(1.45rem, 6vw, 2rem); letter-spacing: -0.04em; }
.summary-card p { margin: 8px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.55; }
.summary-primary { color: #fff; border-color: var(--forest); background: var(--forest); }
.summary-primary span, .summary-primary strong, .summary-primary p { color: #fff; }
.summary-primary p { opacity: 0.76; }

.map-section, .cashflow-section, .report-section { margin-top: 38px; }
.section-title-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.section-title-row h2 { margin: 5px 0 0; color: var(--forest-deep); font-family: "Songti TC", "Noto Serif TC", Georgia, serif; font-size: 1.55rem; }
.goal-map { margin-top: 16px; display: grid; gap: 10px; }
.goal-row { padding: 15px; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.goal-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--forest); background: var(--forest-soft); font-size: 1.2rem; }
.goal-copy { min-width: 0; }
.goal-copy strong { display: flex; justify-content: space-between; gap: 10px; color: var(--forest-deep); }
.goal-copy strong b { white-space: nowrap; color: var(--rose); }
.goal-copy p { margin: 5px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.55; }

.cashflow-grid { margin-top: 16px; display: grid; gap: 10px; }
.cashflow-item { padding: 16px; border-radius: 17px; background: var(--forest-soft); }
.cashflow-item span { display: block; color: var(--muted); font-size: 0.8rem; }
.cashflow-item strong { display: block; margin-top: 6px; color: var(--forest-deep); font-size: 1.08rem; }
.cashflow-tip { margin: 12px 0 0; padding: 14px 16px; border-left: 3px solid var(--gold); color: #5d594c; background: #fbf6e9; font-size: 0.88rem; line-height: 1.65; }
.result-notice { margin-top: 30px; padding: 17px; border-radius: 18px; color: #6e5729; background: var(--gold-soft); }
.result-notice strong { display: block; }
.result-notice p { margin: 7px 0 0; font-size: 0.82rem; line-height: 1.65; }
.report-section textarea { width: 100%; min-height: 320px; margin-top: 15px; resize: vertical; border: 1px solid var(--line); border-radius: 18px; padding: 16px; color: var(--ink); background: #fff; line-height: 1.7; outline: none; }
.copy-status { min-height: 20px; margin: 7px 0 0; color: var(--forest); font-size: 0.84rem; }
.next-step-card { margin-top: 30px; padding: 22px; border-radius: 22px; color: #fff; background: var(--forest-deep); }
.next-step-card span { color: #e7c979; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.1em; }
.next-step-card h2 { margin: 8px 0 0; font-family: "Songti TC", "Noto Serif TC", Georgia, serif; font-size: 1.45rem; line-height: 1.45; }
.next-step-card p { margin: 8px 0 18px; color: rgba(255,255,255,0.7); font-size: 0.88rem; line-height: 1.65; }
.next-step-card .line-action { width: 100%; color: var(--forest-deep); background: #fff; }
.result-actions { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.planner-footer { padding: 0 22px 42px; text-align: center; color: var(--muted); }
.planner-footer a { color: var(--forest); font-family: "Songti TC", "Noto Serif TC", Georgia, serif; font-weight: 800; }
.planner-footer p { margin: 7px 0 0; font-size: 0.8rem; }

@media (min-width: 640px) {
  .planner-header { height: 78px; padding: 0 30px; }
  .planner-brand { width: 205px; }
  .planner-brand img { width: 250px; height: 58px; transform: translateX(-22px); }
  .planner-shell { padding-top: 44px; }
  .welcome-card { padding: 54px 52px 38px; }
  .welcome-card > .primary-action { width: auto; min-width: 300px; }
  .question-card { padding: 38px 42px 30px; }
  .choice-grid.two-columns { grid-template-columns: 1fr 1fr; }
  .result-view { padding: 44px 42px 34px; }
  .result-summary-grid { grid-template-columns: repeat(3, 1fr); }
  .cashflow-grid { grid-template-columns: repeat(3, 1fr); }
  .next-step-card { padding: 28px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px; }
  .next-step-card p { margin-bottom: 0; }
  .next-step-card .line-action { width: auto; min-width: 220px; }
}

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