:root {
  --paper: #f5f0e2;
  --paper-dark: #e8dfc9;
  --ink: #243b31;
  --muted: #647164;
  --jade: #35533f;
  --jade-deep: #263f33;
  --jade-light: #e1e5d5;
  --olive: #64734c;
  --gold: #ab843f;
  --gold-light: #d9bc77;
  --cinnabar: #943f30;
  --line: rgba(41, 63, 48, 0.14);
  --shadow: 0 10px 24px rgba(34, 52, 40, 0.1);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: "PingFang SC", "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  background:
    radial-gradient(circle at 100% 0, rgba(85, 109, 76, 0.2), transparent 35%),
    linear-gradient(180deg, #fbf7ec 0%, var(--paper) 44%, #eee7d6 100%);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  line-height: 1;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.paper-texture {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.42;
  background-image: radial-gradient(rgba(80, 66, 45, 0.09) 0.6px, transparent 0.6px);
  background-size: 5px 5px;
}

.page-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(26px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 18px;
}

.topbar__mark {
  display: grid;
  place-items: center;
  flex: 0 0 47px;
  width: 47px;
  height: 47px;
  color: var(--gold-light);
  font-size: 20px;
  background: var(--jade-deep);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 5px rgba(232, 219, 181, 0.16);
}

.topbar__eyebrow {
  margin: 0 0 4px;
  color: #98722f;
  font-size: 11px;
  letter-spacing: 0.24em;
}

h1 {
  margin: 0;
  color: #253c34;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.hero {
  position: relative;
  overflow: hidden;
  height: 209px;
  border-radius: 25px;
  border: 1px solid rgba(171, 132, 63, 0.2);
  background: #e3e5d5;
  box-shadow: var(--shadow);
}

.carousel__track {
  display: flex;
  height: 100%;
  transition: transform 420ms ease;
}

.hero-slide {
  position: relative;
  display: flex;
  flex: 0 0 100%;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  overflow: hidden;
  background-color: #e2e6d4;
  background-position: center;
  background-size: cover;
}

.hero-slide::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 83% 18%, rgba(255, 254, 246, 0.92), transparent 27%),
    linear-gradient(94deg, rgba(246, 240, 222, 0.98) 3%, rgba(246, 240, 222, 0.83) 53%, transparent 100%);
}

.hero-slide--leaf::after,
.hero-slide--tea::after {
  position: absolute;
  right: -15px;
  bottom: -12px;
  width: 154px;
  height: 174px;
  content: "";
  opacity: 0.9;
  border-radius: 75% 25% 65% 35%;
  transform: rotate(-18deg);
}

.hero-slide--leaf::after {
  background:
    radial-gradient(circle at 45% 38%, var(--gold-light) 0 8%, transparent 9%),
    radial-gradient(circle at 58% 50%, var(--cinnabar) 0 6%, transparent 7%),
    linear-gradient(135deg, var(--jade-deep), #879365);
}

.hero-slide--tea::after {
  border: 2px solid rgba(53, 83, 63, 0.2);
  background:
    radial-gradient(ellipse at 46% 51%, #a98143 0 27%, #dcc687 28% 33%, transparent 34%),
    linear-gradient(145deg, var(--olive), #d9ddc9);
}

.hero-slide__content {
  position: relative;
  z-index: 1;
  max-width: 61%;
}

.hero-slide__label {
  min-height: 24px;
  line-height: 18px;
  display: inline-block;
  margin-bottom: 9px;
  padding: 3px 10px;
  color: var(--jade-deep);
  font-size: 11px;
  background: rgba(224, 229, 209, 0.9);
  border-radius: 20px;
}

.hero-slide h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.28;
}

.hero-slide p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.carousel__dots {
  position: absolute;
  bottom: 13px;
  left: 22px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.carousel__dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(53, 83, 63, 0.27);
  transition: all 180ms ease;
}

.carousel__dot.is-active {
  width: 19px;
  border-radius: 5px;
  background: var(--jade);
}

.intro {
  margin: 14px 0 22px;
  padding: 15px 17px;
  color: #526358;
  font-size: 13px;
  line-height: 1.75;
  background: rgba(255, 252, 242, 0.7);
  border: 1px solid rgba(171, 132, 63, 0.2);
  border-radius: 15px;
}

.intro p {
  margin: 0;
}

.intro p + p {
  margin-top: 3px;
}

.service-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 0 20px;
  padding: 5px;
  background: #e2e2d2;
  border-radius: 17px;
}

.service-tab {
  gap: 4px;
  min-height: 54px;
  line-height: 1;
  color: #516252;
  font-size: 13px;
  background: transparent;
  border-radius: 13px;
}

.service-tab strong {
  font-size: 15px;
  font-weight: 600;
}

.service-tab.is-active {
  color: #fffdf6;
  background: linear-gradient(135deg, var(--jade-deep), var(--jade));
  box-shadow: 0 6px 14px rgba(38, 63, 51, 0.25), inset 0 -2px 0 rgba(217, 188, 119, 0.22);
}

.panel {
  animation: reveal 240ms ease;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 15px;
}

.panel-heading__tag {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.panel-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.subsidy-badge,
.course-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  color: var(--cinnabar);
  font-size: 12px;
  background: #f4e5d5;
  border-radius: 20px;
}

.course-badge {
  color: var(--jade);
  background: var(--jade-light);
}

.filter-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 7px;
  margin-bottom: 20px;
}

.filter-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 4px;
  border: 1px solid #ddd7c6;
  line-height: 1;
  color: #4f6052;
  font-size: 13px;
  background: #fffdf7;
  border-radius: 18px;
}

.filter-chip.is-active {
  border-color: var(--jade);
  color: #fff;
  background: linear-gradient(135deg, var(--jade-deep), var(--jade));
  box-shadow: inset 0 -2px 0 rgba(217, 188, 119, 0.2);
}

.filter-chips--large {
  grid-template-columns: repeat(2, 1fr);
}

.filter-chips--large .filter-chip {
  height: 41px;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.product-card,
.course-card {
  position: relative;
  display: flex;
  gap: 13px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.92);
  border-radius: var(--radius);
  box-shadow: 0 5px 16px rgba(59, 64, 49, 0.045);
}

.product-card__image,
.course-card__image {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 98px;
  height: 111px;
  overflow: hidden;
  color: rgba(44, 91, 73, 0.62);
  font-size: 30px;
  background-position: center;
  background-size: cover;
  border-radius: 12px;
}

.product-card__image::before,
.course-card__image::before {
  position: absolute;
  inset: 8px;
  content: "";
  border: 1px solid rgba(52, 109, 89, 0.12);
  border-radius: 9px;
}

.tone-1 {
  background: linear-gradient(145deg, #eef2e3, #d8dfc7);
}

.tone-2 {
  background: linear-gradient(145deg, #f5eddb, #e7dac0);
}

.tone-3 {
  background: linear-gradient(145deg, #eee7d7, #ded2b8);
}

.tone-4 {
  background: linear-gradient(145deg, #e7eddf, #d2dfd4);
}

.product-card__body,
.course-card__body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.product-card__name,
.course-card__name {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.product-card__benefit,
.course-card__intro {
  display: -webkit-box;
  min-height: 35px;
  overflow: hidden;
  margin: 0 0 6px;
  color: #6b796f;
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.field-label {
  color: #52665d;
}

.price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.price-old {
  color: #999688;
  font-size: 11px;
  text-decoration: line-through;
}

.price-subsidy {
  color: var(--cinnabar);
  font-size: 12px;
}

.price-subsidy strong {
  font-size: 21px;
  line-height: 1;
}

.card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(154, 72, 53, 0.23);
  color: var(--cinnabar);
  font-size: 11px;
  background: #fcf2eb;
  border-radius: 12px;
}

.course-card__image {
  flex-basis: 111px;
  height: 87px;
  color: white;
  font-size: 0;
  background: linear-gradient(145deg, var(--jade-deep), #788c62);
}

.course-card__image::after {
  z-index: 1;
  width: 35px;
  height: 35px;
  content: "";
  background: rgba(255, 253, 247, 0.9);
  clip-path: polygon(38% 26%, 38% 74%, 76% 50%);
  border-radius: 50%;
}

.course-card__intro {
  min-height: auto;
  margin-bottom: 5px;
  -webkit-line-clamp: 1;
}

.course-price {
  margin: 0;
  color: var(--cinnabar);
  font-size: 14px;
}

.course-price strong {
  font-size: 19px;
}

.product-card wx-open-launch-weapp {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
}

.mini-launch-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.fallback-action {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  color: transparent;
  background: transparent;
}

.course-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  font-size: 0;
}

.empty-state {
  padding: 36px 20px;
  color: #718077;
  text-align: center;
  border: 1px dashed #d9d2bd;
  background: rgba(255, 253, 247, 0.65);
  border-radius: var(--radius);
}

.footer {
  margin-top: 30px;
  padding: 17px 10px 0;
  color: #8b8b7a;
  font-size: 11px;
  line-height: 1.65;
  text-align: center;
  border-top: 1px solid var(--line);
}

.footer p {
  margin: 0 0 8px;
}

.toast {
  position: fixed;
  bottom: calc(32px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 20;
  max-width: calc(100% - 44px);
  padding: 10px 15px;
  visibility: hidden;
  color: #fffdf6;
  font-size: 13px;
  text-align: center;
  background: rgba(39, 53, 47, 0.9);
  border-radius: 18px;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: 180ms ease;
}

.toast.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 481px) {
  body {
    background-color: #e7e2d7;
  }

  .page-shell {
    min-height: calc(100vh - 24px);
    margin: 12px auto;
    background: var(--paper);
    border-radius: 28px;
    box-shadow: 0 9px 36px rgba(39, 53, 47, 0.1);
  }
}
