﻿:root {
  --bg: #f5efe3;
  --panel: rgba(255, 252, 245, 0.92);
  --text: #1f2a1f;
  --muted: #5f6a5f;
  --accent: #bc5f2c;
  --accent-dark: #93471d;
  --line: rgba(46, 58, 43, 0.14);
  --shadow: 0 20px 60px rgba(90, 62, 26, 0.12);
  --success-bg: rgba(78, 126, 89, 0.16);
  --success-text: #265336;
  --section-gap: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans TC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(188, 95, 44, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(64, 116, 91, 0.18), transparent 28%),
    linear-gradient(180deg, #f8f3ea 0%, var(--bg) 100%);
}

.page {
  width: min(1100px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.page > section + section {
  margin-top: var(--section-gap);
}

.narrow-page {
  width: min(760px, calc(100vw - 32px));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 22px;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.brand span {
  color: var(--accent-dark);
  font-weight: 700;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
}

.nav-action,
.text-button,
.close-auth {
  font: inherit;
  cursor: pointer;
}

.nav-action {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.nav-action.secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid rgba(188, 95, 44, 0.3);
}

.hero {
  padding: 40px 0 28px;
}

.hero-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  align-items: start;
}

.hero.compact {
  padding-bottom: 12px;
}

.eyebrow {
  margin: 0 0 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--accent-dark);
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.06;
  max-width: 10ch;
}

h2,
h3 {
  margin: 0;
}

.lead,
.section-copy,
.faq-list p,
.feature-card p,
.hero-note,
.bullet-list,
.steps,
.recent-job-item span {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions,
.result-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.processing-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 20px 0 8px;
  padding: 0;
  list-style: none;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  color: var(--muted);
  position: relative;
}

.flow-step strong {
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
}

.flow-step::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + 6px);
  width: 12px;
  height: 2px;
  transform: translateY(-50%);
  background: rgba(95, 106, 95, 0.18);
}

.flow-step::before {
  display: none;
}

.flow-step:last-child::after,
.flow-step:last-child::before {
  display: none;
}

.flow-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: rgba(95, 106, 95, 0.22);
  flex: 0 0 auto;
  margin-top: 2px;
}

.flow-step-current {
  color: var(--text);
}

.flow-step-current .flow-dot {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(188, 95, 44, 0.14);
}

.flow-step-current::after {
  background: rgba(188, 95, 44, 0.4);
}

.flow-step-current::before {
  display: none;
}

.flow-step-done {
  color: var(--text);
}

.flow-step-done .flow-dot {
  background: var(--success-text);
}

.flow-step-done::after {
  background: rgba(38, 83, 54, 0.3);
}

.flow-step-done::before {
  display: none;
}

.compact-actions {
  margin-top: 4px;
}

.compact-shift-form {
  gap: 14px;
}

.hero-note {
  margin-top: 14px;
}

.hero-panel {
  padding-top: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.two-up > .card,
.three-up > .card {
  height: 100%;
}

.content-grid {
  display: grid;
  gap: 18px;
}

.content-grid + section,
section + .content-grid {
  margin-top: var(--section-gap);
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-grid {
  align-items: start;
}

.auth-dialog-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.confirm-shell {
  position: fixed;
  inset: 0;
  z-index: 32;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 42, 31, 0.35);
  backdrop-filter: blur(6px);
}

.auth-dialog {
  position: relative;
  width: min(540px, calc(100vw - 24px));
  margin: 8vh auto 0;
  z-index: 1;
  max-height: 84vh;
  overflow: auto;
}

.confirm-dialog {
  position: relative;
  width: min(520px, calc(100vw - 24px));
  margin: 18vh auto 0;
  z-index: 1;
}

.auth-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.close-auth {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 2rem;
  line-height: 1;
}

.auth-switcher {
  margin-top: 14px;
}

.text-button {
  border: none;
  background: transparent;
  color: var(--accent-dark);
  padding: 0;
  font-weight: 600;
}

body.auth-open {
  overflow: hidden;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

.form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 600;
}

.checkbox-field span {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.checkbox-field input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.field small {
  color: var(--muted);
}

.field-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  background: rgba(255, 255, 255, 0.8);
}

textarea {
  resize: vertical;
}

.button,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.button {
  width: fit-content;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.button.secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid rgba(188, 95, 44, 0.3);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(108, 67, 22, 0.14);
}

.button.secondary:hover,
.button.secondary:focus-visible {
  background: rgba(188, 95, 44, 0.08);
}

.button.large-cta {
  min-width: min(100%, 320px);
  padding: 16px 28px;
  font-size: 1.05rem;
}

.modal-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.button[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.text-link {
  margin-top: 14px;
  color: var(--accent-dark);
}

.error,
.notice,
.success-banner {
  margin-bottom: 18px;
  border-radius: 16px;
  padding: 14px 16px;
}

.error {
  background: rgba(188, 55, 44, 0.12);
  color: #8f271e;
}

.notice {
  background: rgba(188, 95, 44, 0.1);
  color: var(--accent-dark);
}

.floating-notice {
  position: sticky;
  top: 14px;
  z-index: 20;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.notice-error {
  background: rgba(188, 55, 44, 0.12);
  color: #8f271e;
}

.notice-success,
.success-banner,
.success-card,
.usage-highlight {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: rgba(38, 83, 54, 0.16);
}

.check-list,
.bullet-list,
.steps {
  margin: 0;
  padding-left: 20px;
}

.bullet-list.compact li {
  margin-bottom: 6px;
}

.pricing-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.price-card {
  display: grid;
  gap: 18px;
  grid-template-rows: auto 1fr auto;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 26px rgba(89, 65, 32, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.price-card.featured {
  background: linear-gradient(180deg, rgba(188, 95, 44, 0.08), rgba(255, 255, 255, 0.86));
  border-color: rgba(188, 95, 44, 0.3);
}

.price-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 38px rgba(89, 65, 32, 0.12);
  border-color: rgba(188, 95, 44, 0.24);
}

.support-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.support-grid .price-card,
.support-card {
  min-height: 100%;
}

.support-form-grid {
  align-items: end;
}

.price {
  margin: 10px 0 0;
  font-size: 2rem;
  font-weight: 800;
}

.price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}

.feature-card h2,
.faq-card h2,
.price-card h3 {
  margin-bottom: 10px;
}

.results,
.recent-jobs-list {
  display: grid;
  gap: 18px;
}

.download-cta-card {
  margin-top: 24px;
}

.processing h2 {
  margin: 0 0 8px;
}

.pulse-bar {
  margin-top: 18px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(188, 95, 44, 0.22), rgba(64, 116, 91, 0.42), rgba(188, 95, 44, 0.22));
  background-size: 200% 100%;
  animation: pulse-slide 1.4s linear infinite;
}

.result-card pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  line-height: 1.6;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.result-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.faq-list,
.status-stack {
  display: grid;
  gap: 16px;
}

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

.result-metrics {
  margin: 18px 0 8px;
}

.metric-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-panel h2,
.auth-card h2 {
  margin-bottom: 6px;
}

.dashboard-hero h1,
.metric-card h2 {
  max-width: none;
}

.dashboard-metrics {
  margin-top: 0;
}

.forest-story,
.forest-metrics {
  margin-top: 0;
}

.forest-story .card:first-child {
  background: linear-gradient(180deg, rgba(95, 150, 106, 0.16), rgba(255, 255, 255, 0.88));
}

.forest-story .card:last-child {
  background: linear-gradient(180deg, rgba(188, 95, 44, 0.12), rgba(255, 255, 255, 0.88));
}

.recent-jobs-empty {
  color: var(--muted);
}

.recent-job-row {
  display: grid;
  gap: 10px;
}

.recent-job-item {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  text-decoration: none;
}

.recent-job-link:hover,
.recent-job-link:focus-visible {
  border-color: rgba(188, 95, 44, 0.26);
  box-shadow: 0 10px 24px rgba(90, 62, 26, 0.08);
}

.recent-job-item div {
  display: grid;
  gap: 4px;
}

.recent-job-item div:last-child {
  justify-items: end;
}

.recent-job-delete-form {
  display: flex;
  justify-content: flex-end;
}

.danger-link {
  color: #9c4a33;
  font-weight: 600;
}

.danger-link:hover,
.danger-link:focus-visible {
  color: #7f3018;
  text-decoration: underline;
}

.cta-card {
  text-align: center;
}

#pricing,
#support-survey {
  position: relative;
  overflow: hidden;
  padding-top: 30px;
  padding-bottom: 30px;
}

#pricing .section-heading,
#support-survey .section-heading {
  margin-bottom: 24px;
}

#pricing {
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(255, 250, 242, 0.96)),
    radial-gradient(circle at top right, rgba(188, 95, 44, 0.08), transparent 34%);
  border-color: rgba(188, 95, 44, 0.18);
}

#pricing::before,
#support-survey::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, rgba(188, 95, 44, 0.22), rgba(64, 116, 91, 0.08), transparent 88%);
}

#support-survey {
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(250, 252, 246, 0.96)),
    radial-gradient(circle at top left, rgba(64, 116, 91, 0.06), transparent 34%);
  border-color: rgba(64, 116, 91, 0.14);
}

#pricing .section-copy,
#support-survey .section-copy {
  max-width: 50rem;
}

#support-survey .form {
  gap: 20px;
}

.feature-card {
  padding-top: 24px;
  padding-bottom: 24px;
}

.feature-card p {
  margin: 0;
}

.faq-card .faq-list {
  gap: 20px;
}

.faq-card .faq-list div {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(46, 58, 43, 0.08);
}

.faq-card .faq-list div:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.cta-card {
  padding-top: 34px;
  padding-bottom: 34px;
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(255, 248, 239, 0.98)),
    radial-gradient(circle at center top, rgba(188, 95, 44, 0.08), transparent 38%);
  border-color: rgba(188, 95, 44, 0.18);
}

.cta-card h2,
.cta-card .lead {
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}

.cta-card .hero-actions {
  justify-content: center;
}

@media (max-width: 960px) {
  .hero-grid,
  .two-up,
  .three-up,
  .pricing-grid,
  .status-grid,
  .recent-job-item {
    grid-template-columns: 1fr;
  }

  .recent-job-item div:last-child {
    justify-items: start;
  }

  .recent-job-delete-form {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  :root {
    --section-gap: 22px;
  }

  .page {
    width: min(100vw - 20px, 980px);
    padding-top: 24px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .card,
  .price-card {
    padding: 20px;
    border-radius: 20px;
  }

  .result-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .flow-step::after {
    display: none;
  }
}

@media (max-width: 420px) {
  .processing-flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

@keyframes pulse-slide {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 200% 50%;
  }
}
