:root {
  --red: #d71920;
  --red-dark: #b90f15;
  --ink: #1e2329;
  --muted: #6b7280;
  --line: #dfe3e8;
  --bg: #f4f5f7;
  --card: #ffffff;
  --pink: #fff0f1;
  --blue: #eef5ff;
  --green: #eff9f1;
  --shadow: 0 8px 24px rgba(30,35,41,.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button, input, textarea { font: inherit; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; background: var(--red); font-weight: 800;
}
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 17px; }
.brand-copy span { font-size: 12px; color: var(--muted); }
.app-shell { width: min(760px, 100%); margin: 0 auto; padding: 20px 14px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 22px; }
.hero { text-align: center; padding: 34px 22px; }
.hero h1 { font-size: 34px; margin: 8px 0 10px; }
.hero p { color: var(--muted); line-height: 1.7; }
.step-kicker { font-weight: 800; color: var(--muted); margin-bottom: 8px; }
h1, h2, h3 { line-height: 1.35; }
h2 { margin: 0 0 10px; font-size: 27px; }
.lead { margin: 0 0 18px; color: var(--muted); line-height: 1.7; }
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.progress .seg { padding: 9px 8px; border-radius: 10px; text-align: center; font-size: 12px; font-weight: 800; background: #e7e9ed; color: #666; }
.progress .seg.active:nth-child(1) { background: #ffe7ea; color: #a80f15; }
.progress .seg.active:nth-child(2) { background: #e7f1ff; color: #1450a3; }
.progress .seg.active:nth-child(3) { background: #e7f6ea; color: #286738; }
.option-list { display: grid; gap: 10px; margin: 16px 0; }
.option {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  background: #fff; cursor: pointer;
}
.option:hover { border-color: #babfc6; }
.option input { margin-top: 4px; transform: scale(1.15); accent-color: var(--red); }
.option strong { display: block; }
.option small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.group { margin: 18px 0 22px; }
.group-title { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.group-help { font-size: 13px; color: var(--muted); margin-bottom: 9px; }
.field { display: grid; gap: 7px; margin: 14px 0; }
.field label { font-weight: 700; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  background: #fff; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(215,25,32,.09); }
.field textarea { min-height: 90px; resize: vertical; }
.other-box { margin: -2px 0 8px 34px; }
.summary-grid { display: grid; gap: 12px; margin: 18px 0; }
.summary-card { border-radius: 14px; padding: 16px; border: 1px solid var(--line); }
.summary-card.market { background: var(--pink); }
.summary-card.resources { background: var(--blue); }
.summary-card.local { background: var(--green); }
.summary-card h3 { margin: 0 0 10px; }
.summary-row { margin: 7px 0; line-height: 1.6; }
.summary-row b { display: inline-block; min-width: 118px; }
.actions { display: flex; gap: 10px; margin-top: 22px; }
.actions .btn { flex: 1; }
.btn {
  border: 0; border-radius: 10px; padding: 13px 18px; font-weight: 800; cursor: pointer;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.notice { padding: 12px 14px; border-radius: 10px; background: #fff8e8; color: #70530c; margin: 14px 0; line-height: 1.6; }
.error { padding: 11px 13px; border-radius: 10px; background: #ffeded; color: #9f1117; margin: 12px 0; }
.success { padding: 14px; border-radius: 10px; background: #edf8ef; color: #246836; margin: 14px 0; }
.counter { font-size: 13px; color: var(--muted); text-align: right; margin-top: -7px; }
.muted { color: var(--muted); }
.inline-tags { display: flex; gap: 7px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #eef0f3; font-size: 13px; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
@media (max-width: 560px) {
  .app-shell { padding: 14px 10px 36px; }
  .card { padding: 18px 15px; border-radius: 14px; }
  h2 { font-size: 23px; }
  .hero h1 { font-size: 29px; }
  .actions { flex-direction: column-reverse; }
  .summary-row b { display: block; min-width: 0; }
}


.status-panel {
  padding: 22px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
  text-align: center;
}
.status-panel p { margin: 8px 0 0; color: var(--muted); line-height: 1.65; }
.spinner {
  width: 30px; height: 30px; margin: 0 auto 12px;
  border: 3px solid #dfe3e8; border-top-color: var(--red); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.opportunity-list { display: grid; gap: 14px; margin-top: 18px; }
.opportunity-card {
  width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; background: #fff; cursor: pointer; box-shadow: 0 5px 16px rgba(30,35,41,.05);
}
.opportunity-card:hover { border-color: #c7ccd2; transform: translateY(-1px); }
.opportunity-card h3 { margin: 10px 0 12px; font-size: 21px; }
.opportunity-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.opp-number { font-weight: 800; color: var(--red); }
.effect-badge {
  display: inline-block; padding: 5px 9px; border-radius: 999px;
  background: #f1f3f5; font-size: 12px; font-weight: 800; color: #4b5563;
}
.opp-line { display: grid; gap: 4px; margin: 9px 0; line-height: 1.55; }
.opp-line b { font-size: 13px; color: #4b5563; }
.opp-line span { color: var(--ink); }
.opp-more { margin-top: 12px; color: var(--red); font-weight: 800; }

.opportunity-detail { display: grid; gap: 14px; margin: 18px 0; }
.detail-effect {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  border-radius: 12px; padding: 14px 16px; background: var(--pink);
}
.detail-effect span { color: var(--muted); font-size: 13px; }
.detail-effect strong { color: #a80f15; }
.detail-block { border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px; background: #fff; }
.detail-block h3 { margin: 0 0 8px; font-size: 16px; }
.detail-block p { margin: 0; line-height: 1.7; color: #353b43; }
.detail-block ul { margin: 0; padding-left: 20px; line-height: 1.7; }
