:root {
  --bg: #f3f8f1;
  --surface: #ffffff;
  --surface-soft: #edf7ef;
  --ink: #17241a;
  --muted: #617065;
  --line: #d7e5d9;
  --green: #2f7d55;
  --green-dark: #195d3b;
  --mint: #dff2e4;
  --sky: #dff0f2;
  --gold: #a76516;
  --shadow: 0 14px 34px rgba(23, 49, 29, 0.12);
  --radius: 8px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--bg);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

img {
  display: block;
  width: 100%;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 12px 12px;
  border-bottom: 1px solid rgba(215, 229, 217, 0.9);
  background: rgba(243, 248, 241, 0.94);
  backdrop-filter: blur(14px);
}

.topbar > p {
  margin-bottom: 4px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.topbar h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: 0;
}

.guide-flow {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 14px 12px calc(28px + var(--safe-bottom));
}

.start-panel {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid #bdddc6;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff, var(--mint));
  box-shadow: var(--shadow);
}

.start-panel > span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 10px;
  padding: 0 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
  font-size: 13px;
  font-weight: 850;
}

.start-panel h2 {
  margin-bottom: 8px;
  font-size: 23px;
  line-height: 1.22;
  letter-spacing: 0;
}

.start-panel p {
  margin-bottom: 0;
  color: #2d5a3f;
  font-size: 15px;
  font-weight: 650;
}

.route-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: route;
}

.route-list li {
  counter-increment: route;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid rgba(47, 125, 85, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: #173b26;
  font-size: 14px;
  font-weight: 800;
}

.route-list li::before {
  content: counter(route);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
}

.category {
  scroll-margin-top: 96px;
  margin-bottom: 26px;
}

.category-head {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
}

.category-head > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
  font-weight: 850;
}

.category-head p {
  margin-bottom: 2px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

.category-head h2 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0;
}

.section-goal {
  margin: -2px 0 12px;
  padding: 11px 12px;
  border: 1px solid #bdddc6;
  border-radius: var(--radius);
  color: #173b26;
  background: var(--mint);
  font-size: 14px;
  font-weight: 700;
}

.flow-next,
.check-line {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #bdddc6;
  border-radius: var(--radius);
  color: #173b26;
  background: var(--mint);
  font-size: 14px;
  font-weight: 750;
}

.flow-next {
  margin-top: 12px;
  background: #ffffff;
}

.button-guide {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.button-guide > img {
  width: 100%;
  background: var(--surface-soft);
}

.button-groups {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.button-group {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
}

.button-group span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 8px;
  padding: 0 9px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
  font-size: 12px;
  font-weight: 850;
}

.button-group h3 {
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.button-group p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.guide-card,
.done-card {
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.guide-card img {
  max-height: 460px;
  object-fit: cover;
  object-position: top center;
  background: var(--surface-soft);
}

.intro-card img {
  max-height: 520px;
}

.text-only {
  padding: 16px;
}

.card-copy {
  padding: 16px;
}

.step-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 10px;
  padding: 0 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.guide-card:nth-of-type(2n) .step-label {
  background: var(--gold);
}

.optional-card .step-label {
  background: #177783;
}

.guide-card h3,
.text-only h3 {
  margin-bottom: 8px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.guide-card p,
.text-only p,
.done-card p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 15px;
}

ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
}

.tip-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #bdddc6;
  border-radius: var(--radius);
  color: #173b26;
  background: var(--mint);
  font-size: 14px;
  font-weight: 650;
}

.done-card {
  padding: 18px;
  color: #173b26;
  background: linear-gradient(135deg, var(--mint), var(--sky));
}

.done-card h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.2;
}

.done-card p {
  margin-bottom: 0;
  color: #275039;
}

a:focus-visible {
  outline: 3px solid rgba(47, 125, 85, 0.45);
  outline-offset: 3px;
}

@media (min-width: 680px) {
  .topbar {
    padding: 18px 18px 12px;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .guide-flow {
    padding: 20px 18px 36px;
  }

  .start-panel {
    padding: 20px;
  }

  .route-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .route-list li {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .category {
    margin-bottom: 34px;
  }

  .button-guide {
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(320px, 1.18fr);
    align-items: start;
  }

  .button-guide > img {
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }

  .button-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    padding: 16px;
  }

  .button-group.wide {
    grid-column: 1 / -1;
  }

  .guide-card:not(.text-only) {
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(300px, 1.05fr);
    align-items: stretch;
  }

  .guide-card:nth-of-type(2n):not(.text-only) img {
    order: 2;
  }

  .guide-card img {
    height: 100%;
    max-height: none;
    object-fit: cover;
  }

  .card-copy {
    display: flex;
    min-height: 320px;
    flex-direction: column;
    justify-content: center;
    padding: 22px;
  }

  .text-only {
    padding: 22px;
  }
}

@media (max-width: 390px) {
  .topbar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .guide-flow {
    padding-left: 10px;
    padding-right: 10px;
  }

  .category-head {
    grid-template-columns: 38px 1fr;
  }

  .category-head > span {
    width: 38px;
    height: 38px;
  }

  .category-head h2 {
    font-size: 19px;
  }

  .start-panel h2 {
    font-size: 21px;
  }

  .guide-card h3,
  .text-only h3 {
    font-size: 20px;
  }
}

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