:root {
  color-scheme: light dark;
  --bg: #edf5f1;
  --surface: #fbfefc;
  --surface-soft: #e4efe9;
  --text: #10271f;
  --text-soft: #596d65;
  --line: #cadbd2;
  --accent: #18845f;
  --accent-strong: #0f6748;
  --accent-soft: #d8eee3;
  --accent-ink: #113e30;
  --danger: #a7352b;
  --shadow: 0 28px 80px rgba(25, 74, 56, 0.14);
  --radius-card: 20px;
  --radius-control: 14px;
  --font-sans: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 4%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

a { color: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

.site-header {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1120px, calc(100% - 36px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  text-decoration: none;
}

.wordmark-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-ink);
  color: #f5fbf8;
  font-weight: 900;
}

.header-note {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.amount-main,
.apply-main {
  width: 100%;
  min-height: calc(100dvh - 128px);
}

.amount-main {
  display: grid;
  place-items: center;
  padding: 34px 18px 48px;
}

.amount-shell,
.apply-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
}

.amount-shell {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.flow-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 26px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 900;
}

.flow-item { text-decoration: none; }
.flow-item.current,
.flow-item.done { color: var(--accent-strong); }
.flow-line { width: 58px; height: 2px; background: var(--line); }
.flow-line.active { background: var(--accent); }

.amount-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 24px;
  align-items: stretch;
}

.amount-intro {
  min-height: 270px;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

.eyebrow,
.form-kicker,
.success-kicker {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.amount-intro h1 {
  max-width: 600px;
  margin: 0;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.amount-intro h1 strong {
  color: var(--accent);
  font-weight: 900;
}

.amount-intro > p:last-child {
  max-width: 480px;
  margin: 18px 0 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.7;
}

.limit-visual {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  padding: 28px;
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--accent-ink);
  color: #eff8f3;
}

.limit-visual::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -72px;
  bottom: -78px;
  border: 34px solid color-mix(in srgb, var(--accent) 70%, transparent);
  border-radius: 50%;
  opacity: 0.5;
  pointer-events: none;
}

.limit-visual > span {
  color: #c7ded4;
  font-size: 13px;
  font-weight: 800;
}

.limit-visual > div {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  z-index: 1;
}

.limit-visual strong {
  font-size: clamp(68px, 9vw, 104px);
  line-height: 0.82;
  letter-spacing: -0.08em;
}

.limit-visual b {
  padding-bottom: 5px;
  color: #b6d6c8;
  font-size: 25px;
}

.limit-visual p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #dcebe4;
  font-size: 14px;
  font-weight: 800;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-top: 20px;
}

.amount-option {
  position: relative;
  min-height: 120px;
  padding: 20px 12px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.amount-option:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.amount-option:active { transform: scale(0.98); }

.amount-option.selected {
  border-color: var(--accent-ink);
  background: var(--accent-ink);
  color: #f1faf5;
  box-shadow: 0 14px 30px rgba(17, 62, 48, 0.22);
}

.amount-option small {
  display: block;
  margin-bottom: 12px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.amount-option.selected small { color: #c8ded4; }

.amount-number {
  display: block;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.amount-number span {
  margin-left: 1px;
  font-size: 0.5em;
  letter-spacing: 0;
}

.featured { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }

.featured-label {
  position: absolute;
  top: -10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--accent);
  color: #f7fcf9;
  font-size: 10px;
  font-weight: 900;
}

.amount-option.selected .featured-label {
  background: #edf7f2;
  color: var(--accent-ink);
}

.selection-bar {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-control);
  display: grid;
  grid-template-columns: minmax(200px, 0.72fr) minmax(300px, 1.28fr);
  gap: 18px;
  align-items: center;
  background: var(--surface-soft);
}

.selection-message {
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.selection-message span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.selection-message strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.selection-message.ready strong { color: var(--accent-strong); }

.primary-button,
.line-button {
  min-height: 58px;
  padding: 10px 20px;
  border: 0;
  border-radius: var(--radius-control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #f8fcfa;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(24, 132, 95, 0.24);
  transition: background-color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.primary-button:hover:not(:disabled),
.line-button:hover { background: var(--accent-strong); }

.primary-button:active:not(:disabled),
.line-button:active { transform: scale(0.985); }

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  box-shadow: none;
}

.amount-continue {
  width: 100%;
  font-size: 17px;
  white-space: nowrap;
}

.amount-option:focus-visible,
.primary-button:focus-visible,
.line-button:focus-visible,
.restart-link:focus-visible,
input:focus-visible,
.warning-option:has(input:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--accent) 34%, transparent);
  outline-offset: 3px;
}

.trust-list {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.trust-list b { color: var(--accent); }

.apply-main { padding: 34px 18px 48px; }
.apply-shell { max-width: 940px; }
.apply-shell > .flow-nav { margin-bottom: 22px; }

.apply-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.4fr);
  gap: 20px;
  align-items: start;
}

.amount-summary,
.form-panel,
.success-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.amount-summary {
  position: sticky;
  top: 24px;
  overflow: hidden;
  padding: 28px;
}

.amount-summary::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -54px;
  top: -58px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.amount-summary > span,
.success-amount span {
  position: relative;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.amount-summary > strong,
.success-amount strong {
  position: relative;
  display: block;
  margin: 8px 0 12px;
  color: var(--accent-strong);
  font-size: clamp(33px, 4vw, 46px);
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
}

.amount-summary > a {
  position: relative;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.summary-note {
  margin-top: 28px;
  padding: 18px;
  border-radius: var(--radius-control);
  background: var(--surface-soft);
}

.summary-note b { font-size: 14px; }
.summary-note p {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

.form-panel { padding: 34px; }
.form-kicker { margin-bottom: 8px; }

.form-heading h1 {
  margin: 0;
  font-size: clamp(31px, 4vw, 43px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.form-heading > p:last-child {
  margin: 10px 0 28px;
  color: var(--text-soft);
  line-height: 1.7;
}

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

.field label,
.warning-fieldset legend {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.field input {
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
}

.field input::placeholder {
  color: color-mix(in srgb, var(--text-soft) 82%, transparent);
}

.field input.invalid { border-color: var(--danger); }

.field-error {
  min-height: 18px;
  margin: 5px 0 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.35;
}

.warning-fieldset {
  margin: 10px 0 0;
  padding: 0;
  border: 0;
}

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

.warning-option { cursor: pointer; }

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

.warning-option > span {
  min-height: 78px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-control);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.warning-option:hover > span { border-color: var(--accent); }
.warning-option:active > span { transform: scale(0.985); }

.warning-option input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.warning-option b {
  color: var(--text);
  font-size: 18px;
}

.warning-option small {
  margin-top: 4px;
  color: var(--text-soft);
}

.warning-help {
  margin: 9px 0 0;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.warning-help.is-rejected {
  color: #b42318;
}

.privacy-note {
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius-control);
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.7;
}

.form-status {
  min-height: 22px;
  margin: 12px 0 4px;
  color: var(--danger);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.submit-button {
  width: 100%;
  font-size: 17px;
  white-space: nowrap;
}

.success-panel {
  width: min(100%, 690px);
  margin: 36px auto;
  padding: 42px 32px;
  text-align: center;
}

.success-mark {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #f6fcf9;
  font-size: 30px;
  font-weight: 900;
}

.success-kicker { margin-bottom: 7px; }

.success-panel h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 47px);
  letter-spacing: -0.045em;
}

.success-panel > p:not(.success-kicker):not(.line-id-label):not(.copy-name-status):not(.line-required-note) {
  max-width: 540px;
  margin: 12px auto 22px;
  color: var(--text-soft);
  line-height: 1.8;
}

.success-intro {
  font-size: 15px;
}

.completion-alert {
  max-width: 540px;
  margin: 0 auto 16px;
  padding: 15px 17px;
  border: 1px solid #e1a73f;
  border-left: 5px solid #c77816;
  border-radius: var(--radius-control);
  background: #fff4d9;
  color: #562f08;
  text-align: left;
}

.completion-alert strong,
.completion-alert span {
  display: block;
}

.completion-alert strong {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 900;
}

.completion-alert span {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
}

.success-amount {
  margin: 0 auto 12px;
  padding: 17px;
  border-radius: var(--radius-control);
  background: var(--accent-soft);
}

.success-amount strong { margin-bottom: 0; }

.line-name-card {
  max-width: 540px;
  margin: 0 auto 16px;
  padding: 19px;
  border: 2px solid var(--accent);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--surface));
}

.line-name-card > span {
  display: block;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.line-name-card > strong {
  display: block;
  margin: 7px 0 13px;
  color: var(--accent-strong);
  font-size: clamp(25px, 6vw, 34px);
  line-height: 1.2;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.copy-name-button {
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.copy-name-button:hover {
  background: var(--accent-soft);
}

.copy-name-status {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.line-steps {
  max-width: 540px;
  margin: 0 auto 20px;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
  text-align: left;
}

.line-steps li {
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  display: flex;
  align-items: center;
  gap: 11px;
}

.line-steps span {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #f6fcf9;
  font-size: 13px;
  font-weight: 900;
}

.line-steps p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.line-button {
  width: min(100%, 540px);
  min-height: 62px;
  font-size: 17px;
  white-space: nowrap;
}

.line-required-note {
  max-width: 540px;
  margin: 10px auto 13px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.6;
}

.line-id-label {
  margin: 12px 0 16px;
  color: var(--text-soft);
  font-size: 13px;
}

.line-id-label strong { color: var(--text); }

.restart-link {
  display: inline-block;
  padding: 7px;
  color: var(--text-soft);
  font-size: 12px;
}

.site-footer {
  padding: 0 18px 28px;
  color: var(--text-soft);
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
}

.site-footer p {
  max-width: 760px;
  margin: 0 auto;
}

noscript {
  display: block;
  padding: 12px;
  background: var(--danger);
  color: #fdf8f7;
  text-align: center;
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  .amount-shell,
  .apply-layout,
  .success-panel {
    animation: enter-page 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

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

@media (max-width: 840px) {
  .amount-hero { grid-template-columns: minmax(0, 1.2fr) minmax(230px, 0.8fr); }
  .amount-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apply-layout { grid-template-columns: 1fr; }
  .amount-summary { position: static; }
  .summary-note { display: none; }
}

@media (max-width: 620px) {
  .header-inner {
    width: min(100% - 28px, 1120px);
    min-height: 60px;
  }

  .wordmark { font-size: 14px; }
  .wordmark-mark { width: 32px; height: 32px; border-radius: 9px; }
  .header-note { font-size: 11px; }

  .amount-main {
    display: block;
    padding: 14px 10px 28px;
  }

  .amount-shell {
    padding: 18px 12px;
    border-radius: 17px;
  }

  .flow-nav { margin-bottom: 18px; }
  .flow-line { width: 40px; }
  .amount-hero { grid-template-columns: 1fr; gap: 10px; }

  .amount-intro {
    min-height: auto;
    padding: 25px 20px;
  }

  .amount-intro h1 { font-size: 43px; }
  .amount-intro > p:last-child { margin-top: 14px; font-size: 14px; }

  .limit-visual {
    min-height: 118px;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: end;
  }

  .limit-visual > div {
    grid-row: 1 / 3;
    grid-column: 2;
  }

  .limit-visual strong { font-size: 61px; }
  .limit-visual b { font-size: 19px; }
  .limit-visual p { align-self: end; }

  .amount-grid { gap: 8px; margin-top: 12px; }

  .amount-option {
    min-height: 105px;
    padding: 17px 9px 13px;
  }

  .amount-number { font-size: 21px; }
  .amount-option small { margin-bottom: 10px; }

  .selection-bar {
    margin-top: 10px;
    padding: 12px;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .selection-message {
    min-height: 40px;
    text-align: center;
  }

  .amount-continue {
    min-height: 58px;
    font-size: 15px;
  }

  .trust-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    text-align: center;
  }

  .apply-main { padding: 14px 10px 30px; }
  .apply-shell > .flow-nav { margin-bottom: 14px; }
  .amount-summary { padding: 20px; }
  .amount-summary > strong { font-size: 35px; }
  .form-panel { padding: 25px 16px; }
  .field-grid { grid-template-columns: 1fr; gap: 8px; }
  .warning-options { gap: 8px; }
  .warning-option > span { min-height: 72px; padding: 12px 10px; }
  .success-panel { margin: 18px auto; padding: 32px 15px; }
  .line-button { min-height: 60px; font-size: 15px; }
  .completion-alert { padding: 13px 14px; }
  .line-name-card { padding: 17px 13px; }
  .copy-name-button { width: 100%; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10221b;
    --surface: #172b23;
    --surface-soft: #20382f;
    --text: #edf7f2;
    --text-soft: #b4c7be;
    --line: #355247;
    --accent: #62c89f;
    --accent-strong: #7bd9b4;
    --accent-soft: #23493a;
    --accent-ink: #0d3529;
    --danger: #ff9b91;
    --shadow: 0 28px 80px rgba(2, 13, 9, 0.28);
  }

  .primary-button,
  .line-button,
  .success-mark,
  .line-steps span {
    color: #0a2a20;
  }

  .amount-option.selected { color: #edf8f3; }
  .amount-option.selected small { color: #bdd8cc; }
  .amount-option.selected .featured-label {
    background: #dcefe6;
    color: #113e30;
  }

  .completion-alert {
    border-color: #b87b27;
    border-left-color: #e3a449;
    background: #342815;
    color: #ffe4ad;
  }

  .copy-name-button {
    background: var(--surface);
  }
}

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