:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #5b6778;
  --line: #d9e0e8;
  --soft: #f2f6f8;
  --paper: #ffffff;
  --green: #11664f;
  --green-dark: #0b4d3d;
  --blue: #244c8f;
  --amber: #8f5f12;
  --danger: #a63232;
  --shadow: 0 18px 40px rgba(24, 33, 47, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", "Noto Sans TC", "Noto Sans HK", Arial, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.topbar,
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 64px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  max-width: 100%;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

nav {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 0.94rem;
  color: var(--muted);
}

nav a {
  flex: 0 0 auto;
  text-decoration: none;
  white-space: nowrap;
}

.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  padding: 72px 32px 110px;
  background: radial-gradient(circle at center, #ffffff 0%, #e2e8f0 100%);
  border-bottom: 1px solid var(--line);
}

.hero-content {
  width: min(720px, 100%);
  color: var(--ink);
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--blue);
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  max-width: 850px;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 3.15rem);
}

p {
  color: var(--muted);
}

.hero p {
  color: var(--muted);
}

.lead {
  max-width: 680px;
  margin: 24px 0 0;
  font-size: 1.25rem;
}

.hero-subtitle {
  margin: 18px 0 0;
  color: var(--green-dark);
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 850;
}

.hero-notice {
  max-width: 760px;
  margin: 22px 0 0;
  padding: 14px 16px;
  border-left: 4px solid var(--green);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 750;
  box-shadow: 0 10px 24px rgba(24, 33, 47, 0.08);
}

.cost-note {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.hero-actions,
.form-actions,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions {
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.button.primary {
  background: var(--green);
  color: white;
}

.button.primary:hover {
  background: var(--green-dark);
}

.button.secondary {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}

.hero .button.secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border-color: var(--line);
}

.band {
  padding: 88px 32px;
}

.band.muted {
  background: var(--soft);
}

.content-grid,
.form-layout {
  width: min(1160px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 64px;
  align-items: start;
}

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

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

.summary-list div,
.support-item,
.benefit-list div,
.criteria-grid div,
.timeline-list div,
.document-link,
.application-form,
.login-form,
.confirmation-panel,
.qr-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary-list div,
.support-item,
.benefit-list div,
.criteria-grid div,
.timeline-list div {
  padding: 20px;
}

.summary-list strong,
.summary-list span,
.support-item strong,
.support-item span,
.benefit-list strong,
.benefit-list span,
.timeline-list strong,
.timeline-list span {
  display: block;
}

.summary-list strong,
.support-item strong,
.benefit-list strong,
.timeline-list strong {
  margin-bottom: 8px;
}

.summary-list span,
.support-item span,
.benefit-list span,
.timeline-list span {
  color: var(--muted);
}

.timeline-list span + span {
  margin-top: 8px;
}

.benefit-list,
.timeline-list {
  display: grid;
  gap: 14px;
}

.evidence-visual {
  width: min(1160px, 100%);
  margin: 38px auto 0;
  padding: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #f4fbf8 52%, #f7f8ff 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.evidence-header {
  max-width: 840px;
}

.evidence-header h3 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.15;
}

.evidence-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.evidence-stats div {
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.evidence-stats strong,
.evidence-stats span {
  display: block;
}

.evidence-stats strong {
  color: var(--green-dark);
  font-size: 1.55rem;
  line-height: 1;
}

.evidence-stats span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.forest-chart {
  display: grid;
  gap: 12px;
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.forest-scale,
.forest-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(220px, 1.4fr) minmax(190px, 0.8fr);
  gap: 16px;
  align-items: center;
}

.forest-scale {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.axis-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.forest-row {
  padding: 12px 0;
  border-top: 1px solid #edf1f5;
}

.forest-row strong {
  color: var(--ink);
}

.forest-axis {
  position: relative;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, #def7ec 0%, #eef4fb 70%, #fff1ea 100%);
  overflow: hidden;
}

.zero-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 87.5%;
  width: 2px;
  background: rgba(24, 33, 47, 0.38);
}

.ci-line {
  position: absolute;
  top: 10px;
  left: var(--ci-start);
  width: var(--ci-width);
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.effect-dot {
  position: absolute;
  top: 50%;
  left: var(--effect-pos);
  width: 16px;
  height: 16px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 4px 10px rgba(24, 33, 47, 0.22);
  transform: translate(-50%, -50%);
}

.forest-value {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: right;
}

.chart-caption {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.criteria-grid ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.criteria-grid li + li {
  margin-top: 8px;
}

.reference-list {
  margin: 0;
  padding: 24px 26px 24px 44px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--muted);
}

.reference-list li + li {
  margin-top: 14px;
}

.reference-list a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.reference-list a:hover {
  text-decoration: underline;
}

.document-grid {
  display: grid;
  gap: 14px;
}

.document-link {
  display: block;
  padding: 22px;
  text-decoration: none;
}

.document-link span,
.document-link small {
  display: block;
}

.document-link span {
  font-weight: 800;
}

.document-link small {
  margin-top: 6px;
  color: var(--muted);
}

.qr-panel {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.qr-panel img {
  width: 104px;
  height: 104px;
}

.qr-panel span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.94rem;
}

.application-form {
  padding: 28px;
}

fieldset {
  margin: 0 0 28px;
  padding: 0;
  border: 0;
}

legend {
  width: 100%;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 850;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  font-weight: 700;
}

input[type="text"],
input[type="tel"],
input[type="password"] {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #bfc9d5;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  background: white;
}

input:focus,
button:focus,
a:focus {
  outline: 3px solid rgba(36, 76, 143, 0.28);
  outline-offset: 2px;
}

.check-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0 0 12px;
  font-weight: 650;
}

.check-row input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.check-row.warning span {
  color: var(--amber);
}

.conditional-panel {
  margin: -2px 0 16px 34px;
  padding: 14px 16px 4px;
  border-left: 3px solid var(--green);
  background: #f7fbf9;
  border-radius: 0 8px 8px 0;
}

.field-note {
  margin: 0 0 10px;
  font-size: 0.94rem;
  font-weight: 700;
}

.fine-print {
  margin-top: 0;
  font-size: 0.94rem;
}

.signature-box {
  height: 260px;
  border: 1px solid #bfc9d5;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  touch-action: none;
}

.signature-box canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.submit {
  width: 100%;
  min-height: 52px;
}

.flash-list {
  margin-bottom: 18px;
}

.flash {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.flash.error {
  color: var(--danger);
  background: #fff2f2;
  border: 1px solid #f0c7c7;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.confirmation,
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--soft);
}

.confirmation-panel,
.login-form {
  width: min(560px, 100%);
  padding: 34px;
}

.application-number {
  margin: 20px 0;
  padding: 18px;
  border-radius: 8px;
  background: #eef8f3;
  color: var(--green-dark);
  font-size: 1.45rem;
  font-weight: 900;
  text-align: center;
}

.admin-topbar {
  position: static;
}

.admin-topbar > div {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-main {
  padding: 28px;
  background: var(--soft);
  min-height: calc(100vh - 64px);
}

.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1540px;
  font-size: 0.9rem;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef3f5;
  color: #354256;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.empty {
  text-align: center;
  color: var(--muted);
}

@media (max-width: 860px) {
  .topbar,
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
    gap: 10px;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    min-height: 76vh;
    padding: 54px 20px 72px;
  }

  .band {
    padding: 56px 20px;
  }

  .content-grid,
  .form-layout,
  .summary-list,
  .support-grid,
  .criteria-grid,
  .evidence-stats {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .evidence-visual,
  .application-form,
  .confirmation-panel,
  .login-form {
    padding: 22px;
  }

  .forest-chart {
    padding: 16px;
  }

  .forest-scale {
    display: none;
  }

  .forest-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .forest-axis {
    min-height: 24px;
  }

  .forest-value {
    text-align: left;
  }

  .signature-box {
    height: 220px;
  }

  .footer {
    flex-direction: column;
    padding: 22px 20px;
  }

  .admin-actions {
    width: 100%;
  }
}
