:root {
  --page: #eef5e6;
  --paper: #f9fcf5;
  --card: #fffefa;
  --ink: #213b2a;
  --ink-soft: #52654f;
  --muted: #899784;
  --green: #4f7d4e;
  --green-mid: #75a168;
  --green-light: #dcebcc;
  --line: rgba(52, 83, 45, 0.1);
  --shadow: 0 12px 30px rgba(45, 73, 38, 0.08);
  --radius: 24px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 300px;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 14%, rgba(255, 255, 255, 0.75) 0 2px, transparent 2.5px) 0 0 / 28px 28px,
    radial-gradient(circle at 84% 72%, rgba(174, 203, 151, 0.25) 0 2px, transparent 2.5px) 0 0 / 34px 34px,
    linear-gradient(145deg, #edf5e4 0%, #e7f1dd 50%, #f2f7eb 100%);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
}

.svg-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 80px rgba(52, 80, 44, 0.12);
}

.knowledge-page {
  min-height: 100vh;
}

/* ---------- 顶部 ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 25px 22px 78px;
  background:
    radial-gradient(circle at 89% 18%, rgba(248, 237, 175, 0.55) 0 9%, transparent 9.4%),
    linear-gradient(152deg, #e4f0d6 0%, #eef7e6 58%, #f8fbf4 100%);
}

/* 返回箭头固定停在「花慢慢」上方 */
.hero .back-chip {
  position: static;
  left: auto;
  top: auto;
  width: 38px;
  height: 38px;
  margin: 0 0 8px -7px;
}

.hero::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -74px;
  width: 220px;
  height: 160px;
  border-radius: 50%;
  background: rgba(199, 223, 174, 0.36);
  z-index: -1;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 250px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 16px;
  color: #79906f;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
}

.eyebrow-mark {
  width: 16px;
  height: 1px;
  background: #8aaa79;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 8.6vw, 39px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: #24452e;
}

.hero-intro {
  margin: 13px 0 0;
  color: #63795e;
  font-size: 13.5px;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.hero-art {
  position: absolute;
  right: -13px;
  bottom: 4px;
  width: 174px;
  height: 174px;
  z-index: 1;
  opacity: 0.96;
  filter: drop-shadow(0 12px 16px rgba(76, 112, 62, 0.08));
}

.hero-badge {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 19px;
  padding: 7px 11px 7px 9px;
  border: 1px solid rgba(87, 126, 73, 0.13);
  border-radius: 999px;
  color: #55734e;
  background: rgba(255, 255, 255, 0.62);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
}

.hero-badge svg {
  width: 17px;
  height: 17px;
  color: #6d9b59;
}

.hero-dot {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  background: #b7d49c;
}

.hero-dot--1 {
  top: 68px;
  right: 152px;
  width: 5px;
  height: 5px;
  opacity: 0.7;
}

.hero-dot--2 {
  top: 34px;
  right: 47px;
  width: 7px;
  height: 7px;
  background: #f0d58e;
  opacity: 0.7;
}

/* ---------- 内容 ---------- */

.page-content {
  position: relative;
  z-index: 3;
  margin-top: -45px;
  padding: 0 18px calc(30px + env(safe-area-inset-bottom));
}

.section {
  margin-top: 25px;
}

.section:first-child {
  margin-top: 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  padding: 0 3px;
}

.section-kicker {
  margin: 0 0 4px;
  color: #97a38f;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.4;
}

.section-head h2 {
  margin: 0;
  color: #2c4b33;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: 0.03em;
}

.section-head h2::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 0 3px 7px;
  border-radius: 50%;
  background: #b2d397;
}

.section-count {
  flex-shrink: 0;
  margin-bottom: 2px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #73826c;
  background: rgba(223, 236, 210, 0.6);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ---------- 养护小贴士 ---------- */

.tips-list {
  display: grid;
  gap: 9px;
}

.tip-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  margin: 0;
  padding: 12px 40px 12px 11px;
  overflow: hidden;
  border: 1px solid rgba(63, 94, 54, 0.07);
  border-radius: 18px;
  background: #f0f7e8;
  box-shadow: 0 4px 16px rgba(69, 96, 54, 0.045);
  animation: rise-in 0.55s both;
}

.tip-card:nth-child(2) {
  animation-delay: 0.07s;
}

.tip-card:nth-child(3) {
  animation-delay: 0.14s;
}

.tip-card--sand {
  background: #fbf6e9;
}

.tip-card--mint {
  background: #edf6f0;
}

.tip-icon {
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 13px;
  color: #57844e;
  background: rgba(255, 255, 255, 0.68);
}

.tip-card--sand .tip-icon {
  color: #b08c52;
  background: rgba(255, 255, 255, 0.72);
}

.tip-card--mint .tip-icon {
  color: #598172;
  background: rgba(255, 255, 255, 0.76);
}

.tip-icon svg {
  width: 24px;
  height: 24px;
}

.tip-card p {
  margin: 0;
  color: #40553b;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.01em;
}

.tip-index {
  position: absolute;
  right: 14px;
  bottom: 6px;
  color: rgba(86, 117, 73, 0.13);
  font-size: 27px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.04em;
  pointer-events: none;
}

.tip-card--sand .tip-index {
  color: rgba(148, 114, 59, 0.13);
}

.tip-card--mint .tip-index {
  color: rgba(66, 105, 91, 0.12);
}

/* ---------- 植物卡片 ---------- */

.plant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.plant-card {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(54, 84, 46, 0.08);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 5px 18px rgba(59, 86, 48, 0.045);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
  animation: rise-in 0.55s both;
}

.plant-card:nth-child(2n) {
  animation-delay: 0.05s;
}

.plant-card:hover {
  transform: translateY(-3px);
  border-color: rgba(87, 126, 73, 0.14);
  box-shadow: 0 12px 26px rgba(55, 84, 45, 0.09);
}

.plant-card:active {
  transform: translateY(-1px) scale(0.985);
}

.plant-card:focus-visible {
  outline: 2px solid #78a566;
  outline-offset: 3px;
}

.plant-media {
  position: relative;
  display: grid;
  height: 119px;
  place-items: center;
  overflow: hidden;
  background: var(--card-tint);
}

.plant-media::before {
  content: "";
  position: absolute;
  top: -29px;
  right: -26px;
  width: 103px;
  height: 103px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.plant-media::after {
  content: "";
  position: absolute;
  bottom: -42px;
  left: -32px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
}

.plant-index {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  color: rgba(56, 82, 47, 0.34);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1;
}

.plant-art {
  position: relative;
  z-index: 1;
  width: 103px;
  height: 103px;
  margin-top: 7px;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.plant-card:hover .plant-art {
  transform: translateY(-2px) scale(1.04);
}

.plant-arrow {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: #607b58;
  background: rgba(255, 255, 255, 0.58);
  opacity: 0.7;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.plant-arrow svg {
  width: 12px;
  height: 12px;
}

.plant-card:hover .plant-arrow {
  opacity: 1;
  transform: translateX(1px);
}

.plant-body {
  padding: 11px 13px 14px;
  background: var(--card);
}

.plant-body h3 {
  margin: 0;
  color: #2e4832;
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.plant-body p {
  min-height: 3em;
  margin: 5px 0 0;
  overflow: hidden;
  color: #75836d;
  font-size: 11px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* ---------- 页脚 ---------- */

.page-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: 31px;
  padding-bottom: 4px;
  color: #a4b09c;
  font-size: 9.5px;
  letter-spacing: 0.11em;
  white-space: nowrap;
}

.footer-line {
  width: 27px;
  height: 1px;
  background: #d9e4d0;
}

/* ---------- 详情页 ---------- */

.detail-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0;
}

.detail-layer[hidden] {
  display: none;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 54, 38, 0.26);
  opacity: 0;
  transition: opacity 0.34s ease;
  backdrop-filter: blur(5px);
}

.detail-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  box-shadow: -18px 0 60px rgba(35, 58, 36, 0.15);
  transform: translateX(100%);
  transition: transform 0.42s cubic-bezier(0.22, 0.78, 0.22, 1);
  -webkit-overflow-scrolling: touch;
}

.detail-layer.is-open .detail-backdrop {
  opacity: 1;
}

.detail-layer.is-open .detail-sheet {
  transform: translateX(0);
}

.detail-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 11px;
  background: rgba(249, 252, 245, 0.9);
  backdrop-filter: blur(16px);
}

.back-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #3e7a57;
  background: transparent;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.back-button:hover {
  background: transparent;
}

.back-button:active {
  transform: scale(0.92);
  opacity: 0.7;
}

.back-button:focus {
  outline: none;
}

.back-button svg {
  width: 21px;
  height: 21px;
}

.detail-nav-title {
  flex: 1;
  color: #819078;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-align: center;
}

.nav-balance {
  width: 76px;
}

.detail-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 139px;
  align-items: center;
  min-height: 202px;
  margin: 3px 14px 0;
  padding: 26px 10px 25px 22px;
  overflow: hidden;
  border: 1px solid rgba(69, 101, 57, 0.06);
  border-radius: 28px;
  background:
    radial-gradient(circle at 91% 13%, rgba(255, 255, 255, 0.52) 0 26%, transparent 26.5%),
    linear-gradient(148deg, var(--detail-tint, #e8f3dc) 0%, #f4f9ee 100%);
}

.detail-hero::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 136px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(222, 195, 129, 0.68);
}

.detail-hero::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -61px;
  width: 165px;
  height: 165px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  z-index: -1;
}

.detail-hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.plant-family {
  display: inline-block;
  margin-bottom: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #607a57;
  background: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.detail-hero h1 {
  margin: 0;
  color: #294730;
  font-size: clamp(27px, 7.4vw, 34px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: 0.06em;
}

.detail-hero-copy > p {
  max-width: 190px;
  margin: 8px 0 0;
  color: #6e8264;
  font-size: 11.5px;
  line-height: 1.65;
}

.detail-hero-art {
  position: relative;
  z-index: 1;
  align-self: center;
  width: 139px;
  height: 139px;
  margin-top: 9px;
  filter: drop-shadow(0 10px 16px rgba(57, 87, 45, 0.09));
}

.detail-body {
  padding: 22px 18px calc(34px + env(safe-area-inset-bottom));
}

.detail-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 12px;
}

.detail-section-head h2 {
  position: relative;
  margin: 0;
  padding-left: 12px;
  color: #2b4a32;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.detail-section-head h2::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: #8fba78;
  transform: translateY(-50%);
}

.detail-section-head span {
  color: #99a493;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.care-list {
  display: grid;
  gap: 9px;
}

.care-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 15px 16px 13px;
  border: 1px solid rgba(61, 91, 52, 0.075);
  border-radius: 19px;
  background: #fffefa;
  box-shadow: 0 4px 16px rgba(61, 88, 48, 0.035);
}

.care-icon {
  display: grid;
  flex: 0 0 auto;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 12px;
  color: var(--care-color, #5d8653);
  background: var(--care-bg, #edf5e5);
}

.care-icon svg {
  width: 21px;
  height: 21px;
}

.care-content {
  min-width: 0;
  padding-top: 1px;
}

.care-content h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #344d37;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: 0.05em;
}

.care-content h3::after {
  content: "";
  width: 15px;
  height: 1px;
  background: #dce6d3;
}

.care-content p {
  margin: 6px 0 0;
  color: #667460;
  font-size: 12.5px;
  line-height: 1.82;
  letter-spacing: 0.005em;
}

.detail-footnote {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 15px;
  padding: 11px 13px;
  border-radius: 14px;
  color: #8a9782;
  background: #f0f6e9;
  font-size: 10px;
  line-height: 1.7;
}

.detail-footnote svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: #7aa063;
}

/* ---------- 内容占位 ---------- */

.placeholder-wrap {
  padding: 4px 0 0;
}

.placeholder-card {
  position: relative;
  overflow: hidden;
  padding: 30px 26px 31px;
  border: 1px dashed #c9dcbb;
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 6%, rgba(217, 234, 201, 0.55) 0 21%, transparent 21.5%),
    #fffefa;
  text-align: center;
}

.placeholder-art {
  width: 105px;
  height: 105px;
  margin: 0 auto 12px;
}

.placeholder-kicker {
  margin: 0 0 7px;
  color: #9cab93;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.placeholder-card h2 {
  margin: 0;
  color: #35513a;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

.placeholder-card p {
  margin: 8px 0 0;
  color: #8b9685;
  font-size: 11.5px;
  line-height: 1.7;
}

.placeholder-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 19px;
  padding: 9px 16px;
  border: 1px solid rgba(79, 119, 60, 0.12);
  border-radius: 999px;
  color: #5b7d50;
  background: #f0f7e8;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.placeholder-back:hover {
  background: #e7f1dc;
}

.placeholder-back:active {
  transform: scale(0.97);
}

.placeholder-back svg {
  width: 14px;
  height: 14px;
}

/* ---------- 动效 ---------- */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.detail-open {
  overflow: hidden;
}

@media (min-width: 560px) {
  body {
    padding: 28px 16px;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
    min-height: 0;
    border-radius: 34px;
    box-shadow:
      0 30px 80px rgba(48, 76, 40, 0.14),
      0 0 0 1px rgba(255, 255, 255, 0.4);
  }

  .knowledge-page {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .detail-layer {
    padding: 28px 16px;
  }

  .detail-backdrop {
    border-radius: 0;
  }

  .detail-sheet {
    height: 100%;
    border-radius: 34px;
  }
}

@media (max-width: 375px) {
  .hero {
    padding-right: 18px;
    padding-left: 18px;
  }

  .hero-art {
    right: -29px;
    width: 158px;
    height: 158px;
  }

  .hero-copy {
    max-width: 224px;
  }

  .page-content {
    padding-right: 14px;
    padding-left: 14px;
  }

  .plant-media {
    height: 110px;
  }

  .plant-art {
    width: 96px;
    height: 96px;
  }

  .plant-body {
    padding: 10px 11px 13px;
  }

  .detail-hero {
    grid-template-columns: minmax(0, 1fr) 122px;
    padding-left: 19px;
  }

  .detail-hero-art {
    width: 122px;
    height: 122px;
  }

  .detail-body {
    padding-right: 14px;
    padding-left: 14px;
  }

  .care-card {
    padding-right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
